home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / libxml2.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  428.9 KB  |  10,552 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import libxml2mod
  5. import types
  6. import sys
  7.  
  8. class libxmlError(Exception):
  9.     pass
  10.  
  11.  
  12. def pos_id(o):
  13.     i = id(o)
  14.     if i < 0:
  15.         return sys.maxint - i
  16.     return i
  17.  
  18.  
  19. class treeError(libxmlError):
  20.     
  21.     def __init__(self, msg):
  22.         self.msg = msg
  23.  
  24.     
  25.     def __str__(self):
  26.         return self.msg
  27.  
  28.  
  29.  
  30. class parserError(libxmlError):
  31.     
  32.     def __init__(self, msg):
  33.         self.msg = msg
  34.  
  35.     
  36.     def __str__(self):
  37.         return self.msg
  38.  
  39.  
  40.  
  41. class uriError(libxmlError):
  42.     
  43.     def __init__(self, msg):
  44.         self.msg = msg
  45.  
  46.     
  47.     def __str__(self):
  48.         return self.msg
  49.  
  50.  
  51.  
  52. class xpathError(libxmlError):
  53.     
  54.     def __init__(self, msg):
  55.         self.msg = msg
  56.  
  57.     
  58.     def __str__(self):
  59.         return self.msg
  60.  
  61.  
  62.  
  63. class ioWrapper:
  64.     
  65.     def __init__(self, _obj):
  66.         self._ioWrapper__io = _obj
  67.         self._o = None
  68.  
  69.     
  70.     def io_close(self):
  71.         if self._ioWrapper__io == None:
  72.             return -1
  73.         self._ioWrapper__io.close()
  74.         self._ioWrapper__io = None
  75.         return 0
  76.  
  77.     
  78.     def io_flush(self):
  79.         if self._ioWrapper__io == None:
  80.             return -1
  81.         self._ioWrapper__io.flush()
  82.         return 0
  83.  
  84.     
  85.     def io_read(self, len = -1):
  86.         if self._ioWrapper__io == None:
  87.             return -1
  88.         if len < 0:
  89.             return self._ioWrapper__io.read()
  90.         return self._ioWrapper__io.read(len)
  91.  
  92.     
  93.     def io_write(self, str, len = -1):
  94.         if self._ioWrapper__io == None:
  95.             return -1
  96.         if len < 0:
  97.             return self._ioWrapper__io.write(str)
  98.         return self._ioWrapper__io.write(str, len)
  99.  
  100.  
  101.  
  102. class ioReadWrapper(ioWrapper):
  103.     
  104.     def __init__(self, _obj, enc = ''):
  105.         ioWrapper.__init__(self, _obj)
  106.         self._o = libxml2mod.xmlCreateInputBuffer(self, enc)
  107.  
  108.     
  109.     def __del__(self):
  110.         print '__del__'
  111.         self.io_close()
  112.         if self._o != None:
  113.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  114.         
  115.         self._o = None
  116.  
  117.     
  118.     def close(self):
  119.         self.io_close()
  120.         if self._o != None:
  121.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  122.         
  123.         self._o = None
  124.  
  125.  
  126.  
  127. class ioWriteWrapper(ioWrapper):
  128.     
  129.     def __init__(self, _obj, enc = ''):
  130.         if type(_obj) == type(''):
  131.             print 'write io from a string'
  132.             self.o = None
  133.         elif type(_obj) == types.InstanceType:
  134.             print 'write io from instance of %s' % _obj.__class__
  135.             ioWrapper.__init__(self, _obj)
  136.             self._o = libxml2mod.xmlCreateOutputBuffer(self, enc)
  137.         else:
  138.             file = libxml2mod.outputBufferGetPythonFile(_obj)
  139.             if file != None:
  140.                 ioWrapper.__init__(self, file)
  141.             else:
  142.                 ioWrapper.__init__(self, _obj)
  143.             self._o = _obj
  144.  
  145.     
  146.     def __del__(self):
  147.         self.io_close()
  148.         if self._o != None:
  149.             libxml2mod.xmlOutputBufferClose(self._o)
  150.         
  151.         self._o = None
  152.  
  153.     
  154.     def flush(self):
  155.         self.io_flush()
  156.         if self._o != None:
  157.             libxml2mod.xmlOutputBufferClose(self._o)
  158.         
  159.         self._o = None
  160.  
  161.     
  162.     def close(self):
  163.         self.io_flush()
  164.         if self._o != None:
  165.             libxml2mod.xmlOutputBufferClose(self._o)
  166.         
  167.         self._o = None
  168.  
  169.  
  170.  
  171. class SAXCallback:
  172.     '''Base class for SAX handlers'''
  173.     
  174.     def startDocument(self):
  175.         '''called at the start of the document'''
  176.         pass
  177.  
  178.     
  179.     def endDocument(self):
  180.         '''called at the end of the document'''
  181.         pass
  182.  
  183.     
  184.     def startElement(self, tag, attrs):
  185.         """called at the start of every element, tag is the name of
  186.            the element, attrs is a dictionary of the element's attributes"""
  187.         pass
  188.  
  189.     
  190.     def endElement(self, tag):
  191.         '''called at the start of every element, tag is the name of
  192.            the element'''
  193.         pass
  194.  
  195.     
  196.     def characters(self, data):
  197.         '''called when character data have been read, data is the string
  198.            containing the data, multiple consecutive characters() callback
  199.            are possible.'''
  200.         pass
  201.  
  202.     
  203.     def cdataBlock(self, data):
  204.         '''called when CDATA section have been read, data is the string
  205.            containing the data, multiple consecutive cdataBlock() callback
  206.            are possible.'''
  207.         pass
  208.  
  209.     
  210.     def reference(self, name):
  211.         '''called when an entity reference has been found'''
  212.         pass
  213.  
  214.     
  215.     def ignorableWhitespace(self, data):
  216.         '''called when potentially ignorable white spaces have been found'''
  217.         pass
  218.  
  219.     
  220.     def processingInstruction(self, target, data):
  221.         '''called when a PI has been found, target contains the PI name and
  222.            data is the associated data in the PI'''
  223.         pass
  224.  
  225.     
  226.     def comment(self, content):
  227.         '''called when a comment has been found, content contains the comment'''
  228.         pass
  229.  
  230.     
  231.     def externalSubset(self, name, externalID, systemID):
  232.         '''called when a DOCTYPE declaration has been found, name is the
  233.            DTD name and externalID, systemID are the DTD public and system
  234.            identifier for that DTd if available'''
  235.         pass
  236.  
  237.     
  238.     def internalSubset(self, name, externalID, systemID):
  239.         '''called when a DOCTYPE declaration has been found, name is the
  240.            DTD name and externalID, systemID are the DTD public and system
  241.            identifier for that DTD if available'''
  242.         pass
  243.  
  244.     
  245.     def entityDecl(self, name, type, externalID, systemID, content):
  246.         """called when an ENTITY declaration has been found, name is the
  247.            entity name and externalID, systemID are the entity public and
  248.            system identifier for that entity if available, type indicates
  249.            the entity type, and content reports it's string content"""
  250.         pass
  251.  
  252.     
  253.     def notationDecl(self, name, externalID, systemID):
  254.         '''called when an NOTATION declaration has been found, name is the
  255.            notation name and externalID, systemID are the notation public and
  256.            system identifier for that notation if available'''
  257.         pass
  258.  
  259.     
  260.     def attributeDecl(self, elem, name, type, defi, defaultValue, nameList):
  261.         '''called when an ATTRIBUTE definition has been found'''
  262.         pass
  263.  
  264.     
  265.     def elementDecl(self, name, type, content):
  266.         '''called when an ELEMENT definition has been found'''
  267.         pass
  268.  
  269.     
  270.     def entityDecl(self, name, publicId, systemID, notationName):
  271.         '''called when an unparsed ENTITY declaration has been found,
  272.            name is the entity name and publicId,, systemID are the entity
  273.            public and system identifier for that entity if available,
  274.            and notationName indicate the associated NOTATION'''
  275.         pass
  276.  
  277.     
  278.     def warning(self, msg):
  279.         pass
  280.  
  281.     
  282.     def error(self, msg):
  283.         raise parserError(msg)
  284.  
  285.     
  286.     def fatalError(self, msg):
  287.         raise parserError(msg)
  288.  
  289.  
  290.  
  291. class xmlCore:
  292.     
  293.     def __init__(self, _obj = None):
  294.         if _obj != None:
  295.             self._o = _obj
  296.             return None
  297.         self._o = None
  298.  
  299.     
  300.     def __eq__(self, other):
  301.         if other == None:
  302.             return False
  303.         ret = libxml2mod.compareNodesEqual(self._o, other._o)
  304.         if ret == None:
  305.             return False
  306.         return ret == True
  307.  
  308.     
  309.     def __ne__(self, other):
  310.         if other == None:
  311.             return True
  312.         ret = libxml2mod.compareNodesEqual(self._o, other._o)
  313.         return not ret
  314.  
  315.     
  316.     def __hash__(self):
  317.         ret = libxml2mod.nodeHash(self._o)
  318.         return ret
  319.  
  320.     
  321.     def __str__(self):
  322.         return self.serialize()
  323.  
  324.     
  325.     def get_parent(self):
  326.         ret = libxml2mod.parent(self._o)
  327.         if ret == None:
  328.             return None
  329.         return xmlNode(_obj = ret)
  330.  
  331.     
  332.     def get_children(self):
  333.         ret = libxml2mod.children(self._o)
  334.         if ret == None:
  335.             return None
  336.         return xmlNode(_obj = ret)
  337.  
  338.     
  339.     def get_last(self):
  340.         ret = libxml2mod.last(self._o)
  341.         if ret == None:
  342.             return None
  343.         return xmlNode(_obj = ret)
  344.  
  345.     
  346.     def get_next(self):
  347.         ret = libxml2mod.next(self._o)
  348.         if ret == None:
  349.             return None
  350.         return xmlNode(_obj = ret)
  351.  
  352.     
  353.     def get_properties(self):
  354.         ret = libxml2mod.properties(self._o)
  355.         if ret == None:
  356.             return None
  357.         return xmlAttr(_obj = ret)
  358.  
  359.     
  360.     def get_prev(self):
  361.         ret = libxml2mod.prev(self._o)
  362.         if ret == None:
  363.             return None
  364.         return xmlNode(_obj = ret)
  365.  
  366.     
  367.     def get_content(self):
  368.         return libxml2mod.xmlNodeGetContent(self._o)
  369.  
  370.     getContent = get_content
  371.     
  372.     def get_name(self):
  373.         return libxml2mod.name(self._o)
  374.  
  375.     
  376.     def get_type(self):
  377.         return libxml2mod.type(self._o)
  378.  
  379.     
  380.     def get_doc(self):
  381.         ret = libxml2mod.doc(self._o)
  382.         if ret == None:
  383.             if self.type in ('document_xml', 'document_html'):
  384.                 return xmlDoc(_obj = self._o)
  385.             return None
  386.         ret == None
  387.         return xmlDoc(_obj = ret)
  388.  
  389.     import sys
  390.     if float(sys.version[0:3]) < 2.2:
  391.         
  392.         def __getattr__(self, attr):
  393.             if attr == 'parent':
  394.                 ret = libxml2mod.parent(self._o)
  395.                 if ret == None:
  396.                     return None
  397.                 return xmlNode(_obj = ret)
  398.             if attr == 'properties':
  399.                 ret = libxml2mod.properties(self._o)
  400.                 if ret == None:
  401.                     return None
  402.                 return xmlAttr(_obj = ret)
  403.             if attr == 'children':
  404.                 ret = libxml2mod.children(self._o)
  405.                 if ret == None:
  406.                     return None
  407.                 return xmlNode(_obj = ret)
  408.             if attr == 'last':
  409.                 ret = libxml2mod.last(self._o)
  410.                 if ret == None:
  411.                     return None
  412.                 return xmlNode(_obj = ret)
  413.             if attr == 'next':
  414.                 ret = libxml2mod.next(self._o)
  415.                 if ret == None:
  416.                     return None
  417.                 return xmlNode(_obj = ret)
  418.             if attr == 'prev':
  419.                 ret = libxml2mod.prev(self._o)
  420.                 if ret == None:
  421.                     return None
  422.                 return xmlNode(_obj = ret)
  423.             if attr == 'content':
  424.                 return libxml2mod.xmlNodeGetContent(self._o)
  425.             if attr == 'name':
  426.                 return libxml2mod.name(self._o)
  427.             if attr == 'type':
  428.                 return libxml2mod.type(self._o)
  429.             if attr == 'doc':
  430.                 ret = libxml2mod.doc(self._o)
  431.                 if ret == None:
  432.                     if self.type == 'document_xml' or self.type == 'document_html':
  433.                         return xmlDoc(_obj = self._o)
  434.                     return None
  435.                 ret == None
  436.                 return xmlDoc(_obj = ret)
  437.             raise AttributeError, attr
  438.  
  439.     else:
  440.         parent = property(get_parent, None, None, 'Parent node')
  441.         children = property(get_children, None, None, 'First child node')
  442.         last = property(get_last, None, None, 'Last sibling node')
  443.         next = property(get_next, None, None, 'Next sibling node')
  444.         prev = property(get_prev, None, None, 'Previous sibling node')
  445.         properties = property(get_properties, None, None, 'List of properies')
  446.         content = property(get_content, None, None, 'Content of this node')
  447.         name = property(get_name, None, None, 'Node name')
  448.         type = property(get_type, None, None, 'Node type')
  449.         doc = property(get_doc, None, None, 'The document this node belongs to')
  450.     
  451.     def serialize(self, encoding = None, format = 0):
  452.         return libxml2mod.serializeNode(self._o, encoding, format)
  453.  
  454.     
  455.     def saveTo(self, file, encoding = None, format = 0):
  456.         return libxml2mod.saveNodeTo(self._o, file, encoding, format)
  457.  
  458.     
  459.     def c14nMemory(self, nodes = None, exclusive = 0, prefixes = None, with_comments = 0):
  460.         if nodes:
  461.             nodes = map((lambda n: n._o), nodes)
  462.         
  463.         return libxml2mod.xmlC14NDocDumpMemory(self.get_doc()._o, nodes, exclusive != 0, prefixes, with_comments != 0)
  464.  
  465.     
  466.     def c14nSaveTo(self, file, nodes = None, exclusive = 0, prefixes = None, with_comments = 0):
  467.         if nodes:
  468.             nodes = map((lambda n: n._o), nodes)
  469.         
  470.         return libxml2mod.xmlC14NDocSaveTo(self.get_doc()._o, nodes, exclusive != 0, prefixes, with_comments != 0, file)
  471.  
  472.     
  473.     def xpathEval(self, expr):
  474.         doc = self.doc
  475.         if doc == None:
  476.             return None
  477.         ctxt = doc.xpathNewContext()
  478.         ctxt.setContextNode(self)
  479.         res = ctxt.xpathEval(expr)
  480.         ctxt.xpathFreeContext()
  481.         return res
  482.  
  483.     
  484.     def xpathEval2(self, expr):
  485.         return self.xpathEval(expr)
  486.  
  487.     
  488.     def removeNsDef(self, href):
  489.         '''
  490.         Remove a namespace definition from a node.  If href is None,
  491.         remove all of the ns definitions on that node.  The removed
  492.         namespaces are returned as a linked list.
  493.  
  494.         Note: If any child nodes referred to the removed namespaces,
  495.         they will be left with dangling links.  You should call
  496.         renciliateNs() to fix those pointers.
  497.  
  498.         Note: This method does not free memory taken by the ns
  499.         definitions.  You will need to free it manually with the
  500.         freeNsList() method on the returns xmlNs object.
  501.         '''
  502.         ret = libxml2mod.xmlNodeRemoveNsDef(self._o, href)
  503.         if ret is None:
  504.             return None
  505.         _xmlCore__tmp = xmlNs(_obj = ret)
  506.         return _xmlCore__tmp
  507.  
  508.     
  509.     def walk_depth_first(self):
  510.         return xmlCoreDepthFirstItertor(self)
  511.  
  512.     
  513.     def walk_breadth_first(self):
  514.         return xmlCoreBreadthFirstItertor(self)
  515.  
  516.     __iter__ = walk_depth_first
  517.     
  518.     def free(self):
  519.         
  520.         try:
  521.             self.doc._ctxt.xpathFreeContext()
  522.         except:
  523.             pass
  524.  
  525.         libxml2mod.xmlFreeDoc(self._o)
  526.  
  527.  
  528.  
  529. class xmlCoreDepthFirstItertor:
  530.     
  531.     def __init__(self, node):
  532.         self.node = node
  533.         self.parents = []
  534.  
  535.     
  536.     def __iter__(self):
  537.         return self
  538.  
  539.     
  540.     def next(self):
  541.         while self.node:
  542.             ret = self.node
  543.             self.parents.append(self.node)
  544.             self.node = self.node.children
  545.             return ret
  546.             
  547.             try:
  548.                 parent = self.parents.pop()
  549.             except IndexError:
  550.                 raise StopIteration
  551.  
  552.             self.node = parent.next
  553.             continue
  554.             return None
  555.  
  556.  
  557.  
  558. class xmlCoreBreadthFirstItertor:
  559.     
  560.     def __init__(self, node):
  561.         self.node = node
  562.         self.parents = []
  563.  
  564.     
  565.     def __iter__(self):
  566.         return self
  567.  
  568.     
  569.     def next(self):
  570.         while self.node:
  571.             ret = self.node
  572.             self.parents.append(self.node)
  573.             self.node = self.node.next
  574.             return ret
  575.             
  576.             try:
  577.                 parent = self.parents.pop()
  578.             except IndexError:
  579.                 raise StopIteration
  580.  
  581.             self.node = parent.children
  582.             continue
  583.             return None
  584.  
  585.  
  586.  
  587. def nodeWrap(o):
  588.     name = libxml2mod.type(o)
  589.     if name == 'element' or name == 'text':
  590.         return xmlNode(_obj = o)
  591.     if name == 'attribute':
  592.         return xmlAttr(_obj = o)
  593.     if name[0:8] == 'document':
  594.         return xmlDoc(_obj = o)
  595.     if name == 'namespace':
  596.         return xmlNs(_obj = o)
  597.     if name == 'elem_decl':
  598.         return xmlElement(_obj = o)
  599.     if name == 'attribute_decl':
  600.         return xmlAttribute(_obj = o)
  601.     if name == 'entity_decl':
  602.         return xmlEntity(_obj = o)
  603.     if name == 'dtd':
  604.         return xmlDtd(_obj = o)
  605.     return xmlNode(_obj = o)
  606.  
  607.  
  608. def xpathObjectRet(o):
  609.     otype = type(o)
  610.     if otype == type([]):
  611.         ret = map(xpathObjectRet, o)
  612.         return ret
  613.     if otype == type(()):
  614.         ret = map(xpathObjectRet, o)
  615.         return tuple(ret)
  616.     if otype == type('') and otype == type(0) or otype == type(0):
  617.         return o
  618.     return nodeWrap(o)
  619.  
  620.  
  621. def registerXPathFunction(ctxt, name, ns_uri, f):
  622.     ret = libxml2mod.xmlRegisterXPathFunction(ctxt, name, ns_uri, f)
  623.  
  624. PARSER_LOADDTD = 1
  625. PARSER_DEFAULTATTRS = 2
  626. PARSER_VALIDATE = 3
  627. PARSER_SUBST_ENTITIES = 4
  628. PARSER_SEVERITY_VALIDITY_WARNING = 1
  629. PARSER_SEVERITY_VALIDITY_ERROR = 2
  630. PARSER_SEVERITY_WARNING = 3
  631. PARSER_SEVERITY_ERROR = 4
  632.  
  633. def registerErrorHandler(f, ctx):
  634.     '''Register a Python written function to for error reporting.
  635.        The function is called back as f(ctx, error). '''
  636.     import sys
  637.     if not sys.modules.has_key('libxslt'):
  638.         ret = libxml2mod.xmlRegisterErrorHandler(f, ctx)
  639.     else:
  640.         import libxslt
  641.         ret = libxslt.registerErrorHandler(f, ctx)
  642.     return ret
  643.  
  644.  
  645. class parserCtxtCore:
  646.     
  647.     def __init__(self, _obj = None):
  648.         if _obj != None:
  649.             self._o = _obj
  650.             return None
  651.         self._o = None
  652.  
  653.     
  654.     def __del__(self):
  655.         if self._o != None:
  656.             libxml2mod.xmlFreeParserCtxt(self._o)
  657.         
  658.         self._o = None
  659.  
  660.     
  661.     def setErrorHandler(self, f, arg):
  662.         '''Register an error handler that will be called back as
  663.            f(arg,msg,severity,reserved).
  664.            
  665.            @reserved is currently always None.'''
  666.         libxml2mod.xmlParserCtxtSetErrorHandler(self._o, f, arg)
  667.  
  668.     
  669.     def getErrorHandler(self):
  670.         '''Return (f,arg) as previously registered with setErrorHandler
  671.            or (None,None).'''
  672.         return libxml2mod.xmlParserCtxtGetErrorHandler(self._o)
  673.  
  674.     
  675.     def addLocalCatalog(self, uri):
  676.         '''Register a local catalog with the parser'''
  677.         return libxml2mod.addLocalCatalog(self._o, uri)
  678.  
  679.  
  680.  
  681. class ValidCtxtCore:
  682.     
  683.     def __init__(self, *args, **kw):
  684.         pass
  685.  
  686.     
  687.     def setValidityErrorHandler(self, err_func, warn_func, arg = None):
  688.         '''
  689.         Register error and warning handlers for DTD validation.
  690.         These will be called back as f(msg,arg)
  691.         '''
  692.         libxml2mod.xmlSetValidErrors(self._o, err_func, warn_func, arg)
  693.  
  694.  
  695.  
  696. class SchemaValidCtxtCore:
  697.     
  698.     def __init__(self, *args, **kw):
  699.         pass
  700.  
  701.     
  702.     def setValidityErrorHandler(self, err_func, warn_func, arg = None):
  703.         '''
  704.         Register error and warning handlers for Schema validation.
  705.         These will be called back as f(msg,arg)
  706.         '''
  707.         libxml2mod.xmlSchemaSetValidErrors(self._o, err_func, warn_func, arg)
  708.  
  709.  
  710.  
  711. class relaxNgValidCtxtCore:
  712.     
  713.     def __init__(self, *args, **kw):
  714.         pass
  715.  
  716.     
  717.     def setValidityErrorHandler(self, err_func, warn_func, arg = None):
  718.         '''
  719.         Register error and warning handlers for RelaxNG validation.
  720.         These will be called back as f(msg,arg)
  721.         '''
  722.         libxml2mod.xmlRelaxNGSetValidErrors(self._o, err_func, warn_func, arg)
  723.  
  724.  
  725.  
  726. def _xmlTextReaderErrorFunc(.0, msg, severity, locator):
  727.     '''Intermediate callback to wrap the locator'''
  728.     (f, arg) = .0
  729.     return f(arg, msg, severity, xmlTextReaderLocator(locator))
  730.  
  731.  
  732. class xmlTextReaderCore:
  733.     
  734.     def __init__(self, _obj = None):
  735.         self.input = None
  736.         if _obj != None:
  737.             self._o = _obj
  738.             return None
  739.         self._o = None
  740.  
  741.     
  742.     def __del__(self):
  743.         if self._o != None:
  744.             libxml2mod.xmlFreeTextReader(self._o)
  745.         
  746.         self._o = None
  747.  
  748.     
  749.     def SetErrorHandler(self, f, arg):
  750.         '''Register an error handler that will be called back as
  751.            f(arg,msg,severity,locator).'''
  752.         if f is None:
  753.             libxml2mod.xmlTextReaderSetErrorHandler(self._o, None, None)
  754.         else:
  755.             libxml2mod.xmlTextReaderSetErrorHandler(self._o, _xmlTextReaderErrorFunc, (f, arg))
  756.  
  757.     
  758.     def GetErrorHandler(self):
  759.         '''Return (f,arg) as previously registered with setErrorHandler
  760.            or (None,None).'''
  761.         (f, arg) = libxml2mod.xmlTextReaderGetErrorHandler(self._o)
  762.         if f is None:
  763.             return (None, None)
  764.         return arg
  765.  
  766.  
  767.  
  768. def cleanupParser():
  769.     libxml2mod.xmlPythonCleanupParser()
  770.  
  771.  
  772. def htmlCreateMemoryParserCtxt(buffer, size):
  773.     '''Create a parser context for an HTML in-memory document. '''
  774.     ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size)
  775.     if ret is None:
  776.         raise parserError('htmlCreateMemoryParserCtxt() failed')
  777.     ret is None
  778.     return parserCtxt(_obj = ret)
  779.  
  780.  
  781. def htmlHandleOmittedElem(val):
  782.     '''Set and return the previous value for handling HTML omitted
  783.        tags. '''
  784.     ret = libxml2mod.htmlHandleOmittedElem(val)
  785.     return ret
  786.  
  787.  
  788. def htmlIsScriptAttribute(name):
  789.     '''Check if an attribute is of content type Script '''
  790.     ret = libxml2mod.htmlIsScriptAttribute(name)
  791.     return ret
  792.  
  793.  
  794. def htmlNewParserCtxt():
  795.     '''Allocate and initialize a new parser context. '''
  796.     ret = libxml2mod.htmlNewParserCtxt()
  797.     if ret is None:
  798.         raise parserError('htmlNewParserCtxt() failed')
  799.     ret is None
  800.     return parserCtxt(_obj = ret)
  801.  
  802.  
  803. def htmlParseDoc(cur, encoding):
  804.     '''parse an HTML in-memory document and build a tree. '''
  805.     ret = libxml2mod.htmlParseDoc(cur, encoding)
  806.     if ret is None:
  807.         raise parserError('htmlParseDoc() failed')
  808.     ret is None
  809.     return xmlDoc(_obj = ret)
  810.  
  811.  
  812. def htmlParseFile(filename, encoding):
  813.     '''parse an HTML file and build a tree. Automatic support for
  814.       ZLIB/Compress compressed document is provided by default if
  815.        found at compile-time. '''
  816.     ret = libxml2mod.htmlParseFile(filename, encoding)
  817.     if ret is None:
  818.         raise parserError('htmlParseFile() failed')
  819.     ret is None
  820.     return xmlDoc(_obj = ret)
  821.  
  822.  
  823. def htmlReadDoc(cur, URL, encoding, options):
  824.     '''parse an XML in-memory document and build a tree. '''
  825.     ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
  826.     if ret is None:
  827.         raise treeError('htmlReadDoc() failed')
  828.     ret is None
  829.     return xmlDoc(_obj = ret)
  830.  
  831.  
  832. def htmlReadFd(fd, URL, encoding, options):
  833.     '''parse an XML from a file descriptor and build a tree. '''
  834.     ret = libxml2mod.htmlReadFd(fd, URL, encoding, options)
  835.     if ret is None:
  836.         raise treeError('htmlReadFd() failed')
  837.     ret is None
  838.     return xmlDoc(_obj = ret)
  839.  
  840.  
  841. def htmlReadFile(filename, encoding, options):
  842.     '''parse an XML file from the filesystem or the network. '''
  843.     ret = libxml2mod.htmlReadFile(filename, encoding, options)
  844.     if ret is None:
  845.         raise treeError('htmlReadFile() failed')
  846.     ret is None
  847.     return xmlDoc(_obj = ret)
  848.  
  849.  
  850. def htmlReadMemory(buffer, size, URL, encoding, options):
  851.     '''parse an XML in-memory document and build a tree. '''
  852.     ret = libxml2mod.htmlReadMemory(buffer, size, URL, encoding, options)
  853.     if ret is None:
  854.         raise treeError('htmlReadMemory() failed')
  855.     ret is None
  856.     return xmlDoc(_obj = ret)
  857.  
  858.  
  859. def htmlIsBooleanAttr(name):
  860.     '''Determine if a given attribute is a boolean attribute. '''
  861.     ret = libxml2mod.htmlIsBooleanAttr(name)
  862.     return ret
  863.  
  864.  
  865. def htmlNewDoc(URI, ExternalID):
  866.     '''Creates a new HTML document '''
  867.     ret = libxml2mod.htmlNewDoc(URI, ExternalID)
  868.     if ret is None:
  869.         raise treeError('htmlNewDoc() failed')
  870.     ret is None
  871.     return xmlDoc(_obj = ret)
  872.  
  873.  
  874. def htmlNewDocNoDtD(URI, ExternalID):
  875.     '''Creates a new HTML document without a DTD node if @URI and
  876.        @ExternalID are None '''
  877.     ret = libxml2mod.htmlNewDocNoDtD(URI, ExternalID)
  878.     if ret is None:
  879.         raise treeError('htmlNewDocNoDtD() failed')
  880.     ret is None
  881.     return xmlDoc(_obj = ret)
  882.  
  883.  
  884. def SAXDefaultVersion(version):
  885.     '''Set the default version of SAX used globally by the
  886.       library. By default, during initialization the default is
  887.       set to 2. Note that it is generally a better coding style
  888.       to use xmlSAXVersion() to set up the version explicitly for
  889.        a given parsing context. '''
  890.     ret = libxml2mod.xmlSAXDefaultVersion(version)
  891.     return ret
  892.  
  893.  
  894. def defaultSAXHandlerInit():
  895.     '''Initialize the default SAX2 handler '''
  896.     libxml2mod.xmlDefaultSAXHandlerInit()
  897.  
  898.  
  899. def docbDefaultSAXHandlerInit():
  900.     '''Initialize the default SAX handler '''
  901.     libxml2mod.docbDefaultSAXHandlerInit()
  902.  
  903.  
  904. def htmlDefaultSAXHandlerInit():
  905.     '''Initialize the default SAX handler '''
  906.     libxml2mod.htmlDefaultSAXHandlerInit()
  907.  
  908.  
  909. def catalogAdd(type, orig, replace):
  910.     '''Add an entry in the catalog, it may overwrite existing but
  911.       different entries. If called before any other catalog
  912.       routine, allows to override the default shared catalog put
  913.        in place by xmlInitializeCatalog(); '''
  914.     ret = libxml2mod.xmlCatalogAdd(type, orig, replace)
  915.     return ret
  916.  
  917.  
  918. def catalogCleanup():
  919.     '''Free up all the memory associated with catalogs '''
  920.     libxml2mod.xmlCatalogCleanup()
  921.  
  922.  
  923. def catalogConvert():
  924.     '''Convert all the SGML catalog entries as XML ones '''
  925.     ret = libxml2mod.xmlCatalogConvert()
  926.     return ret
  927.  
  928.  
  929. def catalogDump(out):
  930.     '''Dump all the global catalog content to the given file. '''
  931.     libxml2mod.xmlCatalogDump(out)
  932.  
  933.  
  934. def catalogGetPublic(pubID):
  935.     '''Try to lookup the catalog reference associated to a public
  936.        ID DEPRECATED, use xmlCatalogResolvePublic() '''
  937.     ret = libxml2mod.xmlCatalogGetPublic(pubID)
  938.     return ret
  939.  
  940.  
  941. def catalogGetSystem(sysID):
  942.     '''Try to lookup the catalog reference associated to a system
  943.        ID DEPRECATED, use xmlCatalogResolveSystem() '''
  944.     ret = libxml2mod.xmlCatalogGetSystem(sysID)
  945.     return ret
  946.  
  947.  
  948. def catalogRemove(value):
  949.     '''Remove an entry from the catalog '''
  950.     ret = libxml2mod.xmlCatalogRemove(value)
  951.     return ret
  952.  
  953.  
  954. def catalogResolve(pubID, sysID):
  955.     '''Do a complete resolution lookup of an External Identifier '''
  956.     ret = libxml2mod.xmlCatalogResolve(pubID, sysID)
  957.     return ret
  958.  
  959.  
  960. def catalogResolvePublic(pubID):
  961.     '''Try to lookup the catalog reference associated to a public
  962.        ID '''
  963.     ret = libxml2mod.xmlCatalogResolvePublic(pubID)
  964.     return ret
  965.  
  966.  
  967. def catalogResolveSystem(sysID):
  968.     '''Try to lookup the catalog resource for a system ID '''
  969.     ret = libxml2mod.xmlCatalogResolveSystem(sysID)
  970.     return ret
  971.  
  972.  
  973. def catalogResolveURI(URI):
  974.     '''Do a complete resolution lookup of an URI '''
  975.     ret = libxml2mod.xmlCatalogResolveURI(URI)
  976.     return ret
  977.  
  978.  
  979. def catalogSetDebug(level):
  980.     '''Used to set the debug level for catalog operation, 0
  981.        disable debugging, 1 enable it '''
  982.     ret = libxml2mod.xmlCatalogSetDebug(level)
  983.     return ret
  984.  
  985.  
  986. def initializeCatalog():
  987.     '''Do the catalog initialization. this function is not thread
  988.       safe, catalog initialization should preferably be done once
  989.        at startup '''
  990.     libxml2mod.xmlInitializeCatalog()
  991.  
  992.  
  993. def loadACatalog(filename):
  994.     '''Load the catalog and build the associated data structures.
  995.       This can be either an XML Catalog or an SGML Catalog It
  996.       will recurse in SGML CATALOG entries. On the other hand XML
  997.        Catalogs are not handled recursively. '''
  998.     ret = libxml2mod.xmlLoadACatalog(filename)
  999.     if ret is None:
  1000.         raise treeError('xmlLoadACatalog() failed')
  1001.     ret is None
  1002.     return catalog(_obj = ret)
  1003.  
  1004.  
  1005. def loadCatalog(filename):
  1006.     '''Load the catalog and makes its definitions effective for
  1007.       the default external entity loader. It will recurse in SGML
  1008.       CATALOG entries. this function is not thread safe, catalog
  1009.        initialization should preferably be done once at startup '''
  1010.     ret = libxml2mod.xmlLoadCatalog(filename)
  1011.     return ret
  1012.  
  1013.  
  1014. def loadCatalogs(pathss):
  1015.     '''Load the catalogs and makes their definitions effective for
  1016.       the default external entity loader. this function is not
  1017.       thread safe, catalog initialization should preferably be
  1018.        done once at startup '''
  1019.     libxml2mod.xmlLoadCatalogs(pathss)
  1020.  
  1021.  
  1022. def loadSGMLSuperCatalog(filename):
  1023.     """Load an SGML super catalog. It won't expand CATALOG or
  1024.       DELEGATE references. This is only needed for manipulating
  1025.       SGML Super Catalogs like adding and removing CATALOG or
  1026.        DELEGATE entries. """
  1027.     ret = libxml2mod.xmlLoadSGMLSuperCatalog(filename)
  1028.     if ret is None:
  1029.         raise treeError('xmlLoadSGMLSuperCatalog() failed')
  1030.     ret is None
  1031.     return catalog(_obj = ret)
  1032.  
  1033.  
  1034. def newCatalog(sgml):
  1035.     '''create a new Catalog. '''
  1036.     ret = libxml2mod.xmlNewCatalog(sgml)
  1037.     if ret is None:
  1038.         raise treeError('xmlNewCatalog() failed')
  1039.     ret is None
  1040.     return catalog(_obj = ret)
  1041.  
  1042.  
  1043. def parseCatalogFile(filename):
  1044.     """parse an XML file and build a tree. It's like
  1045.        xmlParseFile() except it bypass all catalog lookups. """
  1046.     ret = libxml2mod.xmlParseCatalogFile(filename)
  1047.     if ret is None:
  1048.         raise parserError('xmlParseCatalogFile() failed')
  1049.     ret is None
  1050.     return xmlDoc(_obj = ret)
  1051.  
  1052.  
  1053. def isBaseChar(ch):
  1054.     '''This function is DEPRECATED. Use xmlIsBaseChar_ch or
  1055.        xmlIsBaseCharQ instead '''
  1056.     ret = libxml2mod.xmlIsBaseChar(ch)
  1057.     return ret
  1058.  
  1059.  
  1060. def isBlank(ch):
  1061.     '''This function is DEPRECATED. Use xmlIsBlank_ch or
  1062.        xmlIsBlankQ instead '''
  1063.     ret = libxml2mod.xmlIsBlank(ch)
  1064.     return ret
  1065.  
  1066.  
  1067. def isChar(ch):
  1068.     '''This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ
  1069.        instead '''
  1070.     ret = libxml2mod.xmlIsChar(ch)
  1071.     return ret
  1072.  
  1073.  
  1074. def isCombining(ch):
  1075.     '''This function is DEPRECATED. Use xmlIsCombiningQ instead '''
  1076.     ret = libxml2mod.xmlIsCombining(ch)
  1077.     return ret
  1078.  
  1079.  
  1080. def isDigit(ch):
  1081.     '''This function is DEPRECATED. Use xmlIsDigit_ch or
  1082.        xmlIsDigitQ instead '''
  1083.     ret = libxml2mod.xmlIsDigit(ch)
  1084.     return ret
  1085.  
  1086.  
  1087. def isExtender(ch):
  1088.     '''This function is DEPRECATED. Use xmlIsExtender_ch or
  1089.        xmlIsExtenderQ instead '''
  1090.     ret = libxml2mod.xmlIsExtender(ch)
  1091.     return ret
  1092.  
  1093.  
  1094. def isIdeographic(ch):
  1095.     '''This function is DEPRECATED. Use xmlIsIdeographicQ instead '''
  1096.     ret = libxml2mod.xmlIsIdeographic(ch)
  1097.     return ret
  1098.  
  1099.  
  1100. def isPubidChar(ch):
  1101.     '''This function is DEPRECATED. Use xmlIsPubidChar_ch or
  1102.        xmlIsPubidCharQ instead '''
  1103.     ret = libxml2mod.xmlIsPubidChar(ch)
  1104.     return ret
  1105.  
  1106.  
  1107. def boolToText(boolval):
  1108.     '''Convenient way to turn bool into text '''
  1109.     ret = libxml2mod.xmlBoolToText(boolval)
  1110.     return ret
  1111.  
  1112.  
  1113. def debugDumpString(output, str):
  1114.     '''Dumps informations about the string, shorten it if necessary '''
  1115.     libxml2mod.xmlDebugDumpString(output, str)
  1116.  
  1117.  
  1118. def shellPrintXPathError(errorType, arg):
  1119.     '''Print the xpath error to libxml default error channel '''
  1120.     libxml2mod.xmlShellPrintXPathError(errorType, arg)
  1121.  
  1122.  
  1123. def dictCleanup():
  1124.     '''Free the dictionary mutex. '''
  1125.     libxml2mod.xmlDictCleanup()
  1126.  
  1127.  
  1128. def addEncodingAlias(name, alias):
  1129.     '''Registers an alias @alias for an encoding named @name.
  1130.        Existing alias will be overwritten. '''
  1131.     ret = libxml2mod.xmlAddEncodingAlias(name, alias)
  1132.     return ret
  1133.  
  1134.  
  1135. def cleanupCharEncodingHandlers():
  1136.     '''Cleanup the memory allocated for the char encoding support,
  1137.        it unregisters all the encoding handlers and the aliases. '''
  1138.     libxml2mod.xmlCleanupCharEncodingHandlers()
  1139.  
  1140.  
  1141. def cleanupEncodingAliases():
  1142.     '''Unregisters all aliases '''
  1143.     libxml2mod.xmlCleanupEncodingAliases()
  1144.  
  1145.  
  1146. def delEncodingAlias(alias):
  1147.     '''Unregisters an encoding alias @alias '''
  1148.     ret = libxml2mod.xmlDelEncodingAlias(alias)
  1149.     return ret
  1150.  
  1151.  
  1152. def encodingAlias(alias):
  1153.     '''Lookup an encoding name for the given alias. '''
  1154.     ret = libxml2mod.xmlGetEncodingAlias(alias)
  1155.     return ret
  1156.  
  1157.  
  1158. def initCharEncodingHandlers():
  1159.     """Initialize the char encoding support, it registers the
  1160.       default encoding supported. NOTE: while public, this
  1161.       function usually doesn't need to be called in normal
  1162.        processing. """
  1163.     libxml2mod.xmlInitCharEncodingHandlers()
  1164.  
  1165.  
  1166. def cleanupPredefinedEntities():
  1167.     '''Cleanup up the predefined entities table. Deprecated call '''
  1168.     libxml2mod.xmlCleanupPredefinedEntities()
  1169.  
  1170.  
  1171. def initializePredefinedEntities():
  1172.     '''Set up the predefined entities. Deprecated call '''
  1173.     libxml2mod.xmlInitializePredefinedEntities()
  1174.  
  1175.  
  1176. def predefinedEntity(name):
  1177.     '''Check whether this name is an predefined entity. '''
  1178.     ret = libxml2mod.xmlGetPredefinedEntity(name)
  1179.     if ret is None:
  1180.         raise treeError('xmlGetPredefinedEntity() failed')
  1181.     ret is None
  1182.     return xmlEntity(_obj = ret)
  1183.  
  1184.  
  1185. def cleanupGlobals():
  1186.     '''Additional cleanup for multi-threading '''
  1187.     libxml2mod.xmlCleanupGlobals()
  1188.  
  1189.  
  1190. def initGlobals():
  1191.     '''Additional initialisation for multi-threading '''
  1192.     libxml2mod.xmlInitGlobals()
  1193.  
  1194.  
  1195. def thrDefDefaultBufferSize(v):
  1196.     ret = libxml2mod.xmlThrDefDefaultBufferSize(v)
  1197.     return ret
  1198.  
  1199.  
  1200. def thrDefDoValidityCheckingDefaultValue(v):
  1201.     ret = libxml2mod.xmlThrDefDoValidityCheckingDefaultValue(v)
  1202.     return ret
  1203.  
  1204.  
  1205. def thrDefGetWarningsDefaultValue(v):
  1206.     ret = libxml2mod.xmlThrDefGetWarningsDefaultValue(v)
  1207.     return ret
  1208.  
  1209.  
  1210. def thrDefIndentTreeOutput(v):
  1211.     ret = libxml2mod.xmlThrDefIndentTreeOutput(v)
  1212.     return ret
  1213.  
  1214.  
  1215. def thrDefKeepBlanksDefaultValue(v):
  1216.     ret = libxml2mod.xmlThrDefKeepBlanksDefaultValue(v)
  1217.     return ret
  1218.  
  1219.  
  1220. def thrDefLineNumbersDefaultValue(v):
  1221.     ret = libxml2mod.xmlThrDefLineNumbersDefaultValue(v)
  1222.     return ret
  1223.  
  1224.  
  1225. def thrDefLoadExtDtdDefaultValue(v):
  1226.     ret = libxml2mod.xmlThrDefLoadExtDtdDefaultValue(v)
  1227.     return ret
  1228.  
  1229.  
  1230. def thrDefParserDebugEntities(v):
  1231.     ret = libxml2mod.xmlThrDefParserDebugEntities(v)
  1232.     return ret
  1233.  
  1234.  
  1235. def thrDefPedanticParserDefaultValue(v):
  1236.     ret = libxml2mod.xmlThrDefPedanticParserDefaultValue(v)
  1237.     return ret
  1238.  
  1239.  
  1240. def thrDefSaveNoEmptyTags(v):
  1241.     ret = libxml2mod.xmlThrDefSaveNoEmptyTags(v)
  1242.     return ret
  1243.  
  1244.  
  1245. def thrDefSubstituteEntitiesDefaultValue(v):
  1246.     ret = libxml2mod.xmlThrDefSubstituteEntitiesDefaultValue(v)
  1247.     return ret
  1248.  
  1249.  
  1250. def thrDefTreeIndentString(v):
  1251.     ret = libxml2mod.xmlThrDefTreeIndentString(v)
  1252.     return ret
  1253.  
  1254.  
  1255. def nanoFTPCleanup():
  1256.     '''Cleanup the FTP protocol layer. This cleanup proxy
  1257.        informations. '''
  1258.     libxml2mod.xmlNanoFTPCleanup()
  1259.  
  1260.  
  1261. def nanoFTPInit():
  1262.     '''Initialize the FTP protocol layer. Currently it just checks
  1263.        for proxy informations, and get the hostname '''
  1264.     libxml2mod.xmlNanoFTPInit()
  1265.  
  1266.  
  1267. def nanoFTPProxy(host, port, user, passwd, type):
  1268.     '''Setup the FTP proxy informations. This can also be done by
  1269.       using ftp_proxy ftp_proxy_user and ftp_proxy_password
  1270.        environment variables. '''
  1271.     libxml2mod.xmlNanoFTPProxy(host, port, user, passwd, type)
  1272.  
  1273.  
  1274. def nanoFTPScanProxy(URL):
  1275.     '''(Re)Initialize the FTP Proxy context by parsing the URL and
  1276.       finding the protocol host port it indicates. Should be like
  1277.       ftp://myproxy/ or ftp://myproxy:3128/ A None URL cleans up
  1278.        proxy informations. '''
  1279.     libxml2mod.xmlNanoFTPScanProxy(URL)
  1280.  
  1281.  
  1282. def nanoHTTPCleanup():
  1283.     '''Cleanup the HTTP protocol layer. '''
  1284.     libxml2mod.xmlNanoHTTPCleanup()
  1285.  
  1286.  
  1287. def nanoHTTPInit():
  1288.     '''Initialize the HTTP protocol layer. Currently it just
  1289.        checks for proxy informations '''
  1290.     libxml2mod.xmlNanoHTTPInit()
  1291.  
  1292.  
  1293. def nanoHTTPScanProxy(URL):
  1294.     '''(Re)Initialize the HTTP Proxy context by parsing the URL
  1295.       and finding the protocol host port it indicates. Should be
  1296.       like http://myproxy/ or http://myproxy:3128/ A None URL
  1297.        cleans up proxy informations. '''
  1298.     libxml2mod.xmlNanoHTTPScanProxy(URL)
  1299.  
  1300.  
  1301. def createDocParserCtxt(cur):
  1302.     '''Creates a parser context for an XML in-memory document. '''
  1303.     ret = libxml2mod.xmlCreateDocParserCtxt(cur)
  1304.     if ret is None:
  1305.         raise parserError('xmlCreateDocParserCtxt() failed')
  1306.     ret is None
  1307.     return parserCtxt(_obj = ret)
  1308.  
  1309.  
  1310. def initParser():
  1311.     '''Initialization function for the XML parser. This is not
  1312.       reentrant. Call once before processing in case of use in
  1313.        multithreaded programs. '''
  1314.     libxml2mod.xmlInitParser()
  1315.  
  1316.  
  1317. def keepBlanksDefault(val):
  1318.     '''Set and return the previous value for default blanks text
  1319.       nodes support. The 1.x version of the parser used an
  1320.       heuristic to try to detect ignorable white spaces. As a
  1321.       result the SAX callback was generating
  1322.       xmlSAX2IgnorableWhitespace() callbacks instead of
  1323.       characters() one, and when using the DOM output text nodes
  1324.       containing those blanks were not generated. The 2.x and
  1325.       later version will switch to the XML standard way and
  1326.       ignorableWhitespace() are only generated when running the
  1327.       parser in validating mode and when the current element
  1328.       doesn\'t allow CDATA or mixed content. This function is
  1329.       provided as a way to force the standard behavior on 1.X
  1330.       libs and to switch back to the old mode for compatibility
  1331.       when running 1.X client code on 2.X . Upgrade of 1.X code
  1332.       should be done by using xmlIsBlankNode() commodity function
  1333.       to detect the "empty" nodes generated. This value also
  1334.       affect autogeneration of indentation when saving code if
  1335.        blanks sections are kept, indentation is not generated. '''
  1336.     ret = libxml2mod.xmlKeepBlanksDefault(val)
  1337.     return ret
  1338.  
  1339.  
  1340. def lineNumbersDefault(val):
  1341.     '''Set and return the previous value for enabling line numbers
  1342.       in elements contents. This may break on old application and
  1343.        is turned off by default. '''
  1344.     ret = libxml2mod.xmlLineNumbersDefault(val)
  1345.     return ret
  1346.  
  1347.  
  1348. def newParserCtxt():
  1349.     '''Allocate and initialize a new parser context. '''
  1350.     ret = libxml2mod.xmlNewParserCtxt()
  1351.     if ret is None:
  1352.         raise parserError('xmlNewParserCtxt() failed')
  1353.     ret is None
  1354.     return parserCtxt(_obj = ret)
  1355.  
  1356.  
  1357. def parseDTD(ExternalID, SystemID):
  1358.     '''Load and parse an external subset. '''
  1359.     ret = libxml2mod.xmlParseDTD(ExternalID, SystemID)
  1360.     if ret is None:
  1361.         raise parserError('xmlParseDTD() failed')
  1362.     ret is None
  1363.     return xmlDtd(_obj = ret)
  1364.  
  1365.  
  1366. def parseDoc(cur):
  1367.     '''parse an XML in-memory document and build a tree. '''
  1368.     ret = libxml2mod.xmlParseDoc(cur)
  1369.     if ret is None:
  1370.         raise parserError('xmlParseDoc() failed')
  1371.     ret is None
  1372.     return xmlDoc(_obj = ret)
  1373.  
  1374.  
  1375. def parseEntity(filename):
  1376.     '''parse an XML external entity out of context and build a
  1377.       tree.  [78] extParsedEnt ::= TextDecl? content  This
  1378.        correspond to a "Well Balanced" chunk '''
  1379.     ret = libxml2mod.xmlParseEntity(filename)
  1380.     if ret is None:
  1381.         raise parserError('xmlParseEntity() failed')
  1382.     ret is None
  1383.     return xmlDoc(_obj = ret)
  1384.  
  1385.  
  1386. def parseFile(filename):
  1387.     '''parse an XML file and build a tree. Automatic support for
  1388.       ZLIB/Compress compressed document is provided by default if
  1389.        found at compile-time. '''
  1390.     ret = libxml2mod.xmlParseFile(filename)
  1391.     if ret is None:
  1392.         raise parserError('xmlParseFile() failed')
  1393.     ret is None
  1394.     return xmlDoc(_obj = ret)
  1395.  
  1396.  
  1397. def parseMemory(buffer, size):
  1398.     '''parse an XML in-memory block and build a tree. '''
  1399.     ret = libxml2mod.xmlParseMemory(buffer, size)
  1400.     if ret is None:
  1401.         raise parserError('xmlParseMemory() failed')
  1402.     ret is None
  1403.     return xmlDoc(_obj = ret)
  1404.  
  1405.  
  1406. def pedanticParserDefault(val):
  1407.     '''Set and return the previous value for enabling pedantic
  1408.        warnings. '''
  1409.     ret = libxml2mod.xmlPedanticParserDefault(val)
  1410.     return ret
  1411.  
  1412.  
  1413. def readDoc(cur, URL, encoding, options):
  1414.     '''parse an XML in-memory document and build a tree. '''
  1415.     ret = libxml2mod.xmlReadDoc(cur, URL, encoding, options)
  1416.     if ret is None:
  1417.         raise treeError('xmlReadDoc() failed')
  1418.     ret is None
  1419.     return xmlDoc(_obj = ret)
  1420.  
  1421.  
  1422. def readFd(fd, URL, encoding, options):
  1423.     '''parse an XML from a file descriptor and build a tree. NOTE
  1424.       that the file descriptor will not be closed when the reader
  1425.        is closed or reset. '''
  1426.     ret = libxml2mod.xmlReadFd(fd, URL, encoding, options)
  1427.     if ret is None:
  1428.         raise treeError('xmlReadFd() failed')
  1429.     ret is None
  1430.     return xmlDoc(_obj = ret)
  1431.  
  1432.  
  1433. def readFile(filename, encoding, options):
  1434.     '''parse an XML file from the filesystem or the network. '''
  1435.     ret = libxml2mod.xmlReadFile(filename, encoding, options)
  1436.     if ret is None:
  1437.         raise treeError('xmlReadFile() failed')
  1438.     ret is None
  1439.     return xmlDoc(_obj = ret)
  1440.  
  1441.  
  1442. def readMemory(buffer, size, URL, encoding, options):
  1443.     '''parse an XML in-memory document and build a tree. '''
  1444.     ret = libxml2mod.xmlReadMemory(buffer, size, URL, encoding, options)
  1445.     if ret is None:
  1446.         raise treeError('xmlReadMemory() failed')
  1447.     ret is None
  1448.     return xmlDoc(_obj = ret)
  1449.  
  1450.  
  1451. def recoverDoc(cur):
  1452.     '''parse an XML in-memory document and build a tree. In the
  1453.       case the document is not Well Formed, a attempt to build a
  1454.        tree is tried anyway '''
  1455.     ret = libxml2mod.xmlRecoverDoc(cur)
  1456.     if ret is None:
  1457.         raise treeError('xmlRecoverDoc() failed')
  1458.     ret is None
  1459.     return xmlDoc(_obj = ret)
  1460.  
  1461.  
  1462. def recoverFile(filename):
  1463.     '''parse an XML file and build a tree. Automatic support for
  1464.       ZLIB/Compress compressed document is provided by default if
  1465.       found at compile-time. In the case the document is not Well
  1466.        Formed, it attempts to build a tree anyway '''
  1467.     ret = libxml2mod.xmlRecoverFile(filename)
  1468.     if ret is None:
  1469.         raise treeError('xmlRecoverFile() failed')
  1470.     ret is None
  1471.     return xmlDoc(_obj = ret)
  1472.  
  1473.  
  1474. def recoverMemory(buffer, size):
  1475.     '''parse an XML in-memory block and build a tree. In the case
  1476.       the document is not Well Formed, an attempt to build a tree
  1477.        is tried anyway '''
  1478.     ret = libxml2mod.xmlRecoverMemory(buffer, size)
  1479.     if ret is None:
  1480.         raise treeError('xmlRecoverMemory() failed')
  1481.     ret is None
  1482.     return xmlDoc(_obj = ret)
  1483.  
  1484.  
  1485. def substituteEntitiesDefault(val):
  1486.     '''Set and return the previous value for default entity
  1487.       support. Initially the parser always keep entity references
  1488.       instead of substituting entity values in the output. This
  1489.       function has to be used to change the default parser
  1490.       behavior SAX::substituteEntities() has to be used for
  1491.        changing that on a file by file basis. '''
  1492.     ret = libxml2mod.xmlSubstituteEntitiesDefault(val)
  1493.     return ret
  1494.  
  1495.  
  1496. def checkLanguageID(lang):
  1497.     """Checks that the value conforms to the LanguageID
  1498.       production:  NOTE: this is somewhat deprecated, those
  1499.       productions were removed from the XML Second edition.  [33]
  1500.       LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::=
  1501.       ISO639Code |  IanaCode |  UserCode [35] ISO639Code ::=
  1502.       ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' |
  1503.       'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-'
  1504.        ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+ """
  1505.     ret = libxml2mod.xmlCheckLanguageID(lang)
  1506.     return ret
  1507.  
  1508.  
  1509. def copyChar(len, out, val):
  1510.     '''append the char value in the array '''
  1511.     ret = libxml2mod.xmlCopyChar(len, out, val)
  1512.     return ret
  1513.  
  1514.  
  1515. def copyCharMultiByte(out, val):
  1516.     '''append the char value in the array '''
  1517.     ret = libxml2mod.xmlCopyCharMultiByte(out, val)
  1518.     return ret
  1519.  
  1520.  
  1521. def createEntityParserCtxt(URL, ID, base):
  1522.     '''Create a parser context for an external entity Automatic
  1523.       support for ZLIB/Compress compressed document is provided
  1524.        by default if found at compile-time. '''
  1525.     ret = libxml2mod.xmlCreateEntityParserCtxt(URL, ID, base)
  1526.     if ret is None:
  1527.         raise parserError('xmlCreateEntityParserCtxt() failed')
  1528.     ret is None
  1529.     return parserCtxt(_obj = ret)
  1530.  
  1531.  
  1532. def createFileParserCtxt(filename):
  1533.     '''Create a parser context for a file content. Automatic
  1534.       support for ZLIB/Compress compressed document is provided
  1535.        by default if found at compile-time. '''
  1536.     ret = libxml2mod.xmlCreateFileParserCtxt(filename)
  1537.     if ret is None:
  1538.         raise parserError('xmlCreateFileParserCtxt() failed')
  1539.     ret is None
  1540.     return parserCtxt(_obj = ret)
  1541.  
  1542.  
  1543. def createMemoryParserCtxt(buffer, size):
  1544.     '''Create a parser context for an XML in-memory document. '''
  1545.     ret = libxml2mod.xmlCreateMemoryParserCtxt(buffer, size)
  1546.     if ret is None:
  1547.         raise parserError('xmlCreateMemoryParserCtxt() failed')
  1548.     ret is None
  1549.     return parserCtxt(_obj = ret)
  1550.  
  1551.  
  1552. def createURLParserCtxt(filename, options):
  1553.     '''Create a parser context for a file or URL content.
  1554.       Automatic support for ZLIB/Compress compressed document is
  1555.       provided by default if found at compile-time and for file
  1556.        accesses '''
  1557.     ret = libxml2mod.xmlCreateURLParserCtxt(filename, options)
  1558.     if ret is None:
  1559.         raise parserError('xmlCreateURLParserCtxt() failed')
  1560.     ret is None
  1561.     return parserCtxt(_obj = ret)
  1562.  
  1563.  
  1564. def htmlCreateFileParserCtxt(filename, encoding):
  1565.     '''Create a parser context for a file content. Automatic
  1566.       support for ZLIB/Compress compressed document is provided
  1567.        by default if found at compile-time. '''
  1568.     ret = libxml2mod.htmlCreateFileParserCtxt(filename, encoding)
  1569.     if ret is None:
  1570.         raise parserError('htmlCreateFileParserCtxt() failed')
  1571.     ret is None
  1572.     return parserCtxt(_obj = ret)
  1573.  
  1574.  
  1575. def htmlInitAutoClose():
  1576.     '''Initialize the htmlStartCloseIndex for fast lookup of
  1577.       closing tags names. This is not reentrant. Call
  1578.       xmlInitParser() once before processing in case of use in
  1579.        multithreaded programs. '''
  1580.     libxml2mod.htmlInitAutoClose()
  1581.  
  1582.  
  1583. def isLetter(c):
  1584.     '''Check whether the character is allowed by the production
  1585.        [84] Letter ::= BaseChar | Ideographic '''
  1586.     ret = libxml2mod.xmlIsLetter(c)
  1587.     return ret
  1588.  
  1589.  
  1590. def namePop(ctxt):
  1591.     '''Pops the top element name from the name stack '''
  1592.     if ctxt is None:
  1593.         ctxt__o = None
  1594.     else:
  1595.         ctxt__o = ctxt._o
  1596.     ret = libxml2mod.namePop(ctxt__o)
  1597.     return ret
  1598.  
  1599.  
  1600. def namePush(ctxt, value):
  1601.     '''Pushes a new element name on top of the name stack '''
  1602.     if ctxt is None:
  1603.         ctxt__o = None
  1604.     else:
  1605.         ctxt__o = ctxt._o
  1606.     ret = libxml2mod.namePush(ctxt__o, value)
  1607.     return ret
  1608.  
  1609.  
  1610. def nodePop(ctxt):
  1611.     '''Pops the top element node from the node stack '''
  1612.     if ctxt is None:
  1613.         ctxt__o = None
  1614.     else:
  1615.         ctxt__o = ctxt._o
  1616.     ret = libxml2mod.nodePop(ctxt__o)
  1617.     if ret is None:
  1618.         raise treeError('nodePop() failed')
  1619.     ret is None
  1620.     return xmlNode(_obj = ret)
  1621.  
  1622.  
  1623. def nodePush(ctxt, value):
  1624.     '''Pushes a new element node on top of the node stack '''
  1625.     if ctxt is None:
  1626.         ctxt__o = None
  1627.     else:
  1628.         ctxt__o = ctxt._o
  1629.     if value is None:
  1630.         value__o = None
  1631.     else:
  1632.         value__o = value._o
  1633.     ret = libxml2mod.nodePush(ctxt__o, value__o)
  1634.     return ret
  1635.  
  1636.  
  1637. def SAXParseFile(SAX, URI, recover):
  1638.     '''Interface to parse an XML file or resource pointed by an
  1639.        URI to build an event flow to the SAX object '''
  1640.     libxml2mod.xmlSAXParseFile(SAX, URI, recover)
  1641.  
  1642.  
  1643. def createInputBuffer(file, encoding):
  1644.     '''Create a libxml2 input buffer from a Python file '''
  1645.     ret = libxml2mod.xmlCreateInputBuffer(file, encoding)
  1646.     if ret is None:
  1647.         raise treeError('xmlCreateInputBuffer() failed')
  1648.     ret is None
  1649.     return inputBuffer(_obj = ret)
  1650.  
  1651.  
  1652. def createOutputBuffer(file, encoding):
  1653.     '''Create a libxml2 output buffer from a Python file '''
  1654.     ret = libxml2mod.xmlCreateOutputBuffer(file, encoding)
  1655.     if ret is None:
  1656.         raise treeError('xmlCreateOutputBuffer() failed')
  1657.     ret is None
  1658.     return outputBuffer(_obj = ret)
  1659.  
  1660.  
  1661. def createPushParser(SAX, chunk, size, URI):
  1662.     '''Create a progressive XML parser context to build either an
  1663.       event flow if the SAX object is not None, or a DOM tree
  1664.        otherwise. '''
  1665.     ret = libxml2mod.xmlCreatePushParser(SAX, chunk, size, URI)
  1666.     if ret is None:
  1667.         raise parserError('xmlCreatePushParser() failed')
  1668.     ret is None
  1669.     return parserCtxt(_obj = ret)
  1670.  
  1671.  
  1672. def debugMemory(activate):
  1673.     '''Switch on the generation of line number for elements nodes.
  1674.       Also returns the number of bytes allocated and not freed by
  1675.        libxml2 since memory debugging was switched on. '''
  1676.     ret = libxml2mod.xmlDebugMemory(activate)
  1677.     return ret
  1678.  
  1679.  
  1680. def dumpMemory():
  1681.     '''dump the memory allocated in the file .memdump '''
  1682.     libxml2mod.xmlDumpMemory()
  1683.  
  1684.  
  1685. def htmlCreatePushParser(SAX, chunk, size, URI):
  1686.     '''Create a progressive HTML parser context to build either an
  1687.       event flow if the SAX object is not None, or a DOM tree
  1688.        otherwise. '''
  1689.     ret = libxml2mod.htmlCreatePushParser(SAX, chunk, size, URI)
  1690.     if ret is None:
  1691.         raise parserError('htmlCreatePushParser() failed')
  1692.     ret is None
  1693.     return parserCtxt(_obj = ret)
  1694.  
  1695.  
  1696. def htmlSAXParseFile(SAX, URI, encoding):
  1697.     '''Interface to parse an HTML file or resource pointed by an
  1698.        URI to build an event flow to the SAX object '''
  1699.     libxml2mod.htmlSAXParseFile(SAX, URI, encoding)
  1700.  
  1701.  
  1702. def memoryUsed():
  1703.     '''Returns the total amount of memory allocated by libxml2 '''
  1704.     ret = libxml2mod.xmlMemoryUsed()
  1705.     return ret
  1706.  
  1707.  
  1708. def newNode(name):
  1709.     '''Create a new Node '''
  1710.     ret = libxml2mod.xmlNewNode(name)
  1711.     if ret is None:
  1712.         raise treeError('xmlNewNode() failed')
  1713.     ret is None
  1714.     return xmlNode(_obj = ret)
  1715.  
  1716.  
  1717. def pythonCleanupParser():
  1718.     """Cleanup function for the XML library. It tries to reclaim
  1719.       all parsing related global memory allocated for the library
  1720.       processing. It doesn't deallocate any document related
  1721.       memory. Calling this function should not prevent reusing
  1722.       the library but one should call xmlCleanupParser() only
  1723.       when the process has finished using the library or XML
  1724.        document built with it. """
  1725.     libxml2mod.xmlPythonCleanupParser()
  1726.  
  1727.  
  1728. def setEntityLoader(resolver):
  1729.     '''Set the entity resolver as a python function '''
  1730.     ret = libxml2mod.xmlSetEntityLoader(resolver)
  1731.     return ret
  1732.  
  1733.  
  1734. def relaxNGCleanupTypes():
  1735.     '''Cleanup the default Schemas type library associated to
  1736.        RelaxNG '''
  1737.     libxml2mod.xmlRelaxNGCleanupTypes()
  1738.  
  1739.  
  1740. def relaxNGInitTypes():
  1741.     '''Initilize the default type libraries. '''
  1742.     ret = libxml2mod.xmlRelaxNGInitTypes()
  1743.     return ret
  1744.  
  1745.  
  1746. def relaxNGNewMemParserCtxt(buffer, size):
  1747.     '''Create an XML RelaxNGs parse context for that memory buffer
  1748.        expected to contain an XML RelaxNGs file. '''
  1749.     ret = libxml2mod.xmlRelaxNGNewMemParserCtxt(buffer, size)
  1750.     if ret is None:
  1751.         raise parserError('xmlRelaxNGNewMemParserCtxt() failed')
  1752.     ret is None
  1753.     return relaxNgParserCtxt(_obj = ret)
  1754.  
  1755.  
  1756. def relaxNGNewParserCtxt(URL):
  1757.     '''Create an XML RelaxNGs parse context for that file/resource
  1758.        expected to contain an XML RelaxNGs file. '''
  1759.     ret = libxml2mod.xmlRelaxNGNewParserCtxt(URL)
  1760.     if ret is None:
  1761.         raise parserError('xmlRelaxNGNewParserCtxt() failed')
  1762.     ret is None
  1763.     return relaxNgParserCtxt(_obj = ret)
  1764.  
  1765.  
  1766. def buildQName(ncname, prefix, memory, len):
  1767.     '''Builds the QName @prefix:@ncname in @memory if there is
  1768.       enough space and prefix is not None nor empty, otherwise
  1769.       allocate a new string. If prefix is None or empty it
  1770.        returns ncname. '''
  1771.     ret = libxml2mod.xmlBuildQName(ncname, prefix, memory, len)
  1772.     return ret
  1773.  
  1774.  
  1775. def compressMode():
  1776.     '''get the default compression mode used, ZLIB based. '''
  1777.     ret = libxml2mod.xmlGetCompressMode()
  1778.     return ret
  1779.  
  1780.  
  1781. def isXHTML(systemID, publicID):
  1782.     '''Try to find if the document correspond to an XHTML DTD '''
  1783.     ret = libxml2mod.xmlIsXHTML(systemID, publicID)
  1784.     return ret
  1785.  
  1786.  
  1787. def newComment(content):
  1788.     '''Creation of a new node containing a comment. '''
  1789.     ret = libxml2mod.xmlNewComment(content)
  1790.     if ret is None:
  1791.         raise treeError('xmlNewComment() failed')
  1792.     ret is None
  1793.     return xmlNode(_obj = ret)
  1794.  
  1795.  
  1796. def newDoc(version):
  1797.     '''Creates a new XML document '''
  1798.     ret = libxml2mod.xmlNewDoc(version)
  1799.     if ret is None:
  1800.         raise treeError('xmlNewDoc() failed')
  1801.     ret is None
  1802.     return xmlDoc(_obj = ret)
  1803.  
  1804.  
  1805. def newPI(name, content):
  1806.     '''Creation of a processing instruction element. Use
  1807.        xmlDocNewPI preferably to get string interning '''
  1808.     ret = libxml2mod.xmlNewPI(name, content)
  1809.     if ret is None:
  1810.         raise treeError('xmlNewPI() failed')
  1811.     ret is None
  1812.     return xmlNode(_obj = ret)
  1813.  
  1814.  
  1815. def newText(content):
  1816.     '''Creation of a new text node. '''
  1817.     ret = libxml2mod.xmlNewText(content)
  1818.     if ret is None:
  1819.         raise treeError('xmlNewText() failed')
  1820.     ret is None
  1821.     return xmlNode(_obj = ret)
  1822.  
  1823.  
  1824. def newTextLen(content, len):
  1825.     """Creation of a new text node with an extra parameter for the
  1826.        content's length """
  1827.     ret = libxml2mod.xmlNewTextLen(content, len)
  1828.     if ret is None:
  1829.         raise treeError('xmlNewTextLen() failed')
  1830.     ret is None
  1831.     return xmlNode(_obj = ret)
  1832.  
  1833.  
  1834. def setCompressMode(mode):
  1835.     '''set the default compression mode used, ZLIB based Correct
  1836.        values: 0 (uncompressed) to 9 (max compression) '''
  1837.     libxml2mod.xmlSetCompressMode(mode)
  1838.  
  1839.  
  1840. def validateNCName(value, space):
  1841.     '''Check that a value conforms to the lexical space of NCName '''
  1842.     ret = libxml2mod.xmlValidateNCName(value, space)
  1843.     return ret
  1844.  
  1845.  
  1846. def validateNMToken(value, space):
  1847.     '''Check that a value conforms to the lexical space of NMToken '''
  1848.     ret = libxml2mod.xmlValidateNMToken(value, space)
  1849.     return ret
  1850.  
  1851.  
  1852. def validateName(value, space):
  1853.     '''Check that a value conforms to the lexical space of Name '''
  1854.     ret = libxml2mod.xmlValidateName(value, space)
  1855.     return ret
  1856.  
  1857.  
  1858. def validateQName(value, space):
  1859.     '''Check that a value conforms to the lexical space of QName '''
  1860.     ret = libxml2mod.xmlValidateQName(value, space)
  1861.     return ret
  1862.  
  1863.  
  1864. def URIEscape(str):
  1865.     """Escaping routine, does not do validity checks ! It will try
  1866.       to escape the chars needing this, but this is heuristic
  1867.        based it's impossible to be sure. """
  1868.     ret = libxml2mod.xmlURIEscape(str)
  1869.     return ret
  1870.  
  1871.  
  1872. def URIEscapeStr(str, list):
  1873.     '''This routine escapes a string to hex, ignoring reserved
  1874.        characters (a-z) and the characters in the exception list. '''
  1875.     ret = libxml2mod.xmlURIEscapeStr(str, list)
  1876.     return ret
  1877.  
  1878.  
  1879. def URIUnescapeString(str, len, target):
  1880.     '''Unescaping routine, but does not check that the string is
  1881.       an URI. The output is a direct unsigned char translation of
  1882.       %XX values (no encoding) Note that the length of the result
  1883.        can only be smaller or same size as the input string. '''
  1884.     ret = libxml2mod.xmlURIUnescapeString(str, len, target)
  1885.     return ret
  1886.  
  1887.  
  1888. def buildRelativeURI(URI, base):
  1889.     '''Expresses the URI of the reference in terms relative to the
  1890.       base.  Some examples of this operation include: base =
  1891.       "http://site1.com/docs/book1.html" URI input               
  1892.       URI returned docs/pic1.gif                    pic1.gif
  1893.       docs/img/pic1.gif                img/pic1.gif img/pic1.gif 
  1894.       ../img/pic1.gif http://site1.com/docs/pic1.gif   pic1.gif
  1895.       http://site2.com/docs/pic1.gif  
  1896.       http://site2.com/docs/pic1.gif  base = "docs/book1.html"
  1897.       URI input                        URI returned docs/pic1.gif
  1898.       pic1.gif docs/img/pic1.gif                img/pic1.gif
  1899.       img/pic1.gif                     ../img/pic1.gif
  1900.       http://site1.com/docs/pic1.gif  
  1901.       http://site1.com/docs/pic1.gif   Note: if the URI reference
  1902.       is really wierd or complicated, it may be worthwhile to
  1903.       first convert it into a "nice" one by calling xmlBuildURI
  1904.       (using \'base\') before calling this routine, since this
  1905.       routine (for reasonable efficiency) assumes URI has already
  1906.        been through some validation. '''
  1907.     ret = libxml2mod.xmlBuildRelativeURI(URI, base)
  1908.     return ret
  1909.  
  1910.  
  1911. def buildURI(URI, base):
  1912.     '''Computes he final URI of the reference done by checking
  1913.       that the given URI is valid, and building the final URI
  1914.       using the base URI. This is processed according to section
  1915.       5.2 of the RFC 2396  5.2. Resolving Relative References to
  1916.        Absolute Form '''
  1917.     ret = libxml2mod.xmlBuildURI(URI, base)
  1918.     return ret
  1919.  
  1920.  
  1921. def canonicPath(path):
  1922.     '''Constructs a canonic path from the specified path. '''
  1923.     ret = libxml2mod.xmlCanonicPath(path)
  1924.     return ret
  1925.  
  1926.  
  1927. def createURI():
  1928.     '''Simply creates an empty xmlURI '''
  1929.     ret = libxml2mod.xmlCreateURI()
  1930.     if ret is None:
  1931.         raise uriError('xmlCreateURI() failed')
  1932.     ret is None
  1933.     return URI(_obj = ret)
  1934.  
  1935.  
  1936. def normalizeURIPath(path):
  1937.     '''Applies the 5 normalization steps to a path string--that
  1938.       is, RFC 2396 Section 5.2, steps 6.c through 6.g. 
  1939.       Normalization occurs directly on the string, no new
  1940.        allocation is done '''
  1941.     ret = libxml2mod.xmlNormalizeURIPath(path)
  1942.     return ret
  1943.  
  1944.  
  1945. def parseURI(str):
  1946.     '''Parse an URI  URI-reference = [ absoluteURI | relativeURI ]
  1947.        [ "#" fragment ] '''
  1948.     ret = libxml2mod.xmlParseURI(str)
  1949.     if ret is None:
  1950.         raise uriError('xmlParseURI() failed')
  1951.     ret is None
  1952.     return URI(_obj = ret)
  1953.  
  1954.  
  1955. def parseURIRaw(str, raw):
  1956.     '''Parse an URI but allows to keep intact the original
  1957.       fragments.  URI-reference = [ absoluteURI | relativeURI ] [
  1958.        "#" fragment ] '''
  1959.     ret = libxml2mod.xmlParseURIRaw(str, raw)
  1960.     if ret is None:
  1961.         raise uriError('xmlParseURIRaw() failed')
  1962.     ret is None
  1963.     return URI(_obj = ret)
  1964.  
  1965.  
  1966. def pathToURI(path):
  1967.     '''Constructs an URI expressing the existing path '''
  1968.     ret = libxml2mod.xmlPathToURI(path)
  1969.     return ret
  1970.  
  1971.  
  1972. def newValidCtxt():
  1973.     '''Allocate a validation context structure. '''
  1974.     ret = libxml2mod.xmlNewValidCtxt()
  1975.     if ret is None:
  1976.         raise treeError('xmlNewValidCtxt() failed')
  1977.     ret is None
  1978.     return ValidCtxt(_obj = ret)
  1979.  
  1980.  
  1981. def validateNameValue(value):
  1982.     '''Validate that the given value match Name production '''
  1983.     ret = libxml2mod.xmlValidateNameValue(value)
  1984.     return ret
  1985.  
  1986.  
  1987. def validateNamesValue(value):
  1988.     '''Validate that the given value match Names production '''
  1989.     ret = libxml2mod.xmlValidateNamesValue(value)
  1990.     return ret
  1991.  
  1992.  
  1993. def validateNmtokenValue(value):
  1994.     '''Validate that the given value match Nmtoken production  [
  1995.        VC: Name Token ] '''
  1996.     ret = libxml2mod.xmlValidateNmtokenValue(value)
  1997.     return ret
  1998.  
  1999.  
  2000. def validateNmtokensValue(value):
  2001.     '''Validate that the given value match Nmtokens production  [
  2002.        VC: Name Token ] '''
  2003.     ret = libxml2mod.xmlValidateNmtokensValue(value)
  2004.     return ret
  2005.  
  2006.  
  2007. def checkFilename(path):
  2008.     '''function checks to see if @path is a valid source (file,
  2009.       socket...) for XML.  if stat is not available on the target
  2010.        machine, '''
  2011.     ret = libxml2mod.xmlCheckFilename(path)
  2012.     return ret
  2013.  
  2014.  
  2015. def cleanupInputCallbacks():
  2016.     '''clears the entire input callback table. this includes the
  2017.        compiled-in I/O. '''
  2018.     libxml2mod.xmlCleanupInputCallbacks()
  2019.  
  2020.  
  2021. def cleanupOutputCallbacks():
  2022.     '''clears the entire output callback table. this includes the
  2023.        compiled-in I/O callbacks. '''
  2024.     libxml2mod.xmlCleanupOutputCallbacks()
  2025.  
  2026.  
  2027. def fileMatch(filename):
  2028.     '''input from FILE * '''
  2029.     ret = libxml2mod.xmlFileMatch(filename)
  2030.     return ret
  2031.  
  2032.  
  2033. def iOFTPMatch(filename):
  2034.     '''check if the URI matches an FTP one '''
  2035.     ret = libxml2mod.xmlIOFTPMatch(filename)
  2036.     return ret
  2037.  
  2038.  
  2039. def iOHTTPMatch(filename):
  2040.     '''check if the URI matches an HTTP one '''
  2041.     ret = libxml2mod.xmlIOHTTPMatch(filename)
  2042.     return ret
  2043.  
  2044.  
  2045. def normalizeWindowsPath(path):
  2046.     '''This function is obsolete. Please see xmlURIFromPath in
  2047.        uri.c for a better solution. '''
  2048.     ret = libxml2mod.xmlNormalizeWindowsPath(path)
  2049.     return ret
  2050.  
  2051.  
  2052. def parserGetDirectory(filename):
  2053.     '''lookup the directory for that file '''
  2054.     ret = libxml2mod.xmlParserGetDirectory(filename)
  2055.     return ret
  2056.  
  2057.  
  2058. def popInputCallbacks():
  2059.     '''Clear the top input callback from the input stack. this
  2060.        includes the compiled-in I/O. '''
  2061.     ret = libxml2mod.xmlPopInputCallbacks()
  2062.     return ret
  2063.  
  2064.  
  2065. def registerDefaultInputCallbacks():
  2066.     '''Registers the default compiled-in I/O handlers. '''
  2067.     libxml2mod.xmlRegisterDefaultInputCallbacks()
  2068.  
  2069.  
  2070. def registerDefaultOutputCallbacks():
  2071.     '''Registers the default compiled-in I/O handlers. '''
  2072.     libxml2mod.xmlRegisterDefaultOutputCallbacks()
  2073.  
  2074.  
  2075. def registerHTTPPostCallbacks():
  2076.     '''By default, libxml submits HTTP output requests using the
  2077.       "PUT" method. Calling this method changes the HTTP output
  2078.        method to use the "POST" method instead. '''
  2079.     libxml2mod.xmlRegisterHTTPPostCallbacks()
  2080.  
  2081.  
  2082. def lastError():
  2083.     '''Get the last global error registered. This is per thread if
  2084.        compiled with thread support. '''
  2085.     ret = libxml2mod.xmlGetLastError()
  2086.     if ret is None:
  2087.         raise treeError('xmlGetLastError() failed')
  2088.     ret is None
  2089.     return Error(_obj = ret)
  2090.  
  2091.  
  2092. def resetLastError():
  2093.     '''Cleanup the last global error registered. For parsing error
  2094.        this does not change the well-formedness result. '''
  2095.     libxml2mod.xmlResetLastError()
  2096.  
  2097.  
  2098. def newTextReaderFilename(URI):
  2099.     '''Create an xmlTextReader structure fed with the resource at
  2100.        @URI '''
  2101.     ret = libxml2mod.xmlNewTextReaderFilename(URI)
  2102.     if ret is None:
  2103.         raise treeError('xmlNewTextReaderFilename() failed')
  2104.     ret is None
  2105.     return xmlTextReader(_obj = ret)
  2106.  
  2107.  
  2108. def readerForDoc(cur, URL, encoding, options):
  2109.     '''Create an xmltextReader for an XML in-memory document. The
  2110.       parsing flags @options are a combination of xmlParserOption. '''
  2111.     ret = libxml2mod.xmlReaderForDoc(cur, URL, encoding, options)
  2112.     if ret is None:
  2113.         raise treeError('xmlReaderForDoc() failed')
  2114.     ret is None
  2115.     return xmlTextReader(_obj = ret)
  2116.  
  2117.  
  2118. def readerForFd(fd, URL, encoding, options):
  2119.     '''Create an xmltextReader for an XML from a file descriptor.
  2120.       The parsing flags @options are a combination of
  2121.       xmlParserOption. NOTE that the file descriptor will not be
  2122.        closed when the reader is closed or reset. '''
  2123.     ret = libxml2mod.xmlReaderForFd(fd, URL, encoding, options)
  2124.     if ret is None:
  2125.         raise treeError('xmlReaderForFd() failed')
  2126.     ret is None
  2127.     return xmlTextReader(_obj = ret)
  2128.  
  2129.  
  2130. def readerForFile(filename, encoding, options):
  2131.     '''parse an XML file from the filesystem or the network. The
  2132.       parsing flags @options are a combination of xmlParserOption. '''
  2133.     ret = libxml2mod.xmlReaderForFile(filename, encoding, options)
  2134.     if ret is None:
  2135.         raise treeError('xmlReaderForFile() failed')
  2136.     ret is None
  2137.     return xmlTextReader(_obj = ret)
  2138.  
  2139.  
  2140. def readerForMemory(buffer, size, URL, encoding, options):
  2141.     '''Create an xmltextReader for an XML in-memory document. The
  2142.       parsing flags @options are a combination of xmlParserOption. '''
  2143.     ret = libxml2mod.xmlReaderForMemory(buffer, size, URL, encoding, options)
  2144.     if ret is None:
  2145.         raise treeError('xmlReaderForMemory() failed')
  2146.     ret is None
  2147.     return xmlTextReader(_obj = ret)
  2148.  
  2149.  
  2150. def regexpCompile(regexp):
  2151.     '''Parses a regular expression conforming to XML Schemas Part
  2152.       2 Datatype Appendix F and builds an automata suitable for
  2153.        testing strings against that regular expression '''
  2154.     ret = libxml2mod.xmlRegexpCompile(regexp)
  2155.     if ret is None:
  2156.         raise treeError('xmlRegexpCompile() failed')
  2157.     ret is None
  2158.     return xmlReg(_obj = ret)
  2159.  
  2160.  
  2161. def schemaNewMemParserCtxt(buffer, size):
  2162.     '''Create an XML Schemas parse context for that memory buffer
  2163.        expected to contain an XML Schemas file. '''
  2164.     ret = libxml2mod.xmlSchemaNewMemParserCtxt(buffer, size)
  2165.     if ret is None:
  2166.         raise parserError('xmlSchemaNewMemParserCtxt() failed')
  2167.     ret is None
  2168.     return SchemaParserCtxt(_obj = ret)
  2169.  
  2170.  
  2171. def schemaNewParserCtxt(URL):
  2172.     '''Create an XML Schemas parse context for that file/resource
  2173.        expected to contain an XML Schemas file. '''
  2174.     ret = libxml2mod.xmlSchemaNewParserCtxt(URL)
  2175.     if ret is None:
  2176.         raise parserError('xmlSchemaNewParserCtxt() failed')
  2177.     ret is None
  2178.     return SchemaParserCtxt(_obj = ret)
  2179.  
  2180.  
  2181. def schemaCleanupTypes():
  2182.     '''Cleanup the default XML Schemas type library '''
  2183.     libxml2mod.xmlSchemaCleanupTypes()
  2184.  
  2185.  
  2186. def schemaCollapseString(value):
  2187.     '''Removes and normalize white spaces in the string '''
  2188.     ret = libxml2mod.xmlSchemaCollapseString(value)
  2189.     return ret
  2190.  
  2191.  
  2192. def schemaInitTypes():
  2193.     '''Initialize the default XML Schemas type library '''
  2194.     libxml2mod.xmlSchemaInitTypes()
  2195.  
  2196.  
  2197. def schemaWhiteSpaceReplace(value):
  2198.     '''Replaces 0xd, 0x9 and 0xa with a space. '''
  2199.     ret = libxml2mod.xmlSchemaWhiteSpaceReplace(value)
  2200.     return ret
  2201.  
  2202.  
  2203. def UTF8Charcmp(utf1, utf2):
  2204.     '''compares the two UCS4 values '''
  2205.     ret = libxml2mod.xmlUTF8Charcmp(utf1, utf2)
  2206.     return ret
  2207.  
  2208.  
  2209. def UTF8Size(utf):
  2210.     '''calculates the internal size of a UTF8 character '''
  2211.     ret = libxml2mod.xmlUTF8Size(utf)
  2212.     return ret
  2213.  
  2214.  
  2215. def UTF8Strlen(utf):
  2216.     """compute the length of an UTF8 string, it doesn't do a full
  2217.        UTF8 checking of the content of the string. """
  2218.     ret = libxml2mod.xmlUTF8Strlen(utf)
  2219.     return ret
  2220.  
  2221.  
  2222. def UTF8Strloc(utf, utfchar):
  2223.     '''a function to provide the relative location of a UTF8 char '''
  2224.     ret = libxml2mod.xmlUTF8Strloc(utf, utfchar)
  2225.     return ret
  2226.  
  2227.  
  2228. def UTF8Strndup(utf, len):
  2229.     """a strndup for array of UTF8's """
  2230.     ret = libxml2mod.xmlUTF8Strndup(utf, len)
  2231.     return ret
  2232.  
  2233.  
  2234. def UTF8Strpos(utf, pos):
  2235.     '''a function to provide the equivalent of fetching a
  2236.        character from a string array '''
  2237.     ret = libxml2mod.xmlUTF8Strpos(utf, pos)
  2238.     return ret
  2239.  
  2240.  
  2241. def UTF8Strsize(utf, len):
  2242.     '''storage size of an UTF8 string the behaviour is not
  2243.        garanteed if the input string is not UTF-8 '''
  2244.     ret = libxml2mod.xmlUTF8Strsize(utf, len)
  2245.     return ret
  2246.  
  2247.  
  2248. def UTF8Strsub(utf, start, len):
  2249.     '''Create a substring from a given UTF-8 string Note: 
  2250.        positions are given in units of UTF-8 chars '''
  2251.     ret = libxml2mod.xmlUTF8Strsub(utf, start, len)
  2252.     return ret
  2253.  
  2254.  
  2255. def checkUTF8(utf):
  2256.     '''Checks @utf for being valid UTF-8. @utf is assumed to be
  2257.       null-terminated. This function is not super-strict, as it
  2258.       will allow longer UTF-8 sequences than necessary. Note that
  2259.       Java is capable of producing these sequences if provoked.
  2260.       Also note, this routine checks for the 4-byte maximum size,
  2261.        but does not check for 0x10ffff maximum value. '''
  2262.     ret = libxml2mod.xmlCheckUTF8(utf)
  2263.     return ret
  2264.  
  2265.  
  2266. def uCSIsAegeanNumbers(code):
  2267.     '''Check whether the character is part of AegeanNumbers UCS
  2268.        Block '''
  2269.     ret = libxml2mod.xmlUCSIsAegeanNumbers(code)
  2270.     return ret
  2271.  
  2272.  
  2273. def uCSIsAlphabeticPresentationForms(code):
  2274.     '''Check whether the character is part of
  2275.        AlphabeticPresentationForms UCS Block '''
  2276.     ret = libxml2mod.xmlUCSIsAlphabeticPresentationForms(code)
  2277.     return ret
  2278.  
  2279.  
  2280. def uCSIsArabic(code):
  2281.     '''Check whether the character is part of Arabic UCS Block '''
  2282.     ret = libxml2mod.xmlUCSIsArabic(code)
  2283.     return ret
  2284.  
  2285.  
  2286. def uCSIsArabicPresentationFormsA(code):
  2287.     '''Check whether the character is part of
  2288.        ArabicPresentationForms-A UCS Block '''
  2289.     ret = libxml2mod.xmlUCSIsArabicPresentationFormsA(code)
  2290.     return ret
  2291.  
  2292.  
  2293. def uCSIsArabicPresentationFormsB(code):
  2294.     '''Check whether the character is part of
  2295.        ArabicPresentationForms-B UCS Block '''
  2296.     ret = libxml2mod.xmlUCSIsArabicPresentationFormsB(code)
  2297.     return ret
  2298.  
  2299.  
  2300. def uCSIsArmenian(code):
  2301.     '''Check whether the character is part of Armenian UCS Block '''
  2302.     ret = libxml2mod.xmlUCSIsArmenian(code)
  2303.     return ret
  2304.  
  2305.  
  2306. def uCSIsArrows(code):
  2307.     '''Check whether the character is part of Arrows UCS Block '''
  2308.     ret = libxml2mod.xmlUCSIsArrows(code)
  2309.     return ret
  2310.  
  2311.  
  2312. def uCSIsBasicLatin(code):
  2313.     '''Check whether the character is part of BasicLatin UCS Block '''
  2314.     ret = libxml2mod.xmlUCSIsBasicLatin(code)
  2315.     return ret
  2316.  
  2317.  
  2318. def uCSIsBengali(code):
  2319.     '''Check whether the character is part of Bengali UCS Block '''
  2320.     ret = libxml2mod.xmlUCSIsBengali(code)
  2321.     return ret
  2322.  
  2323.  
  2324. def uCSIsBlock(code, block):
  2325.     '''Check whether the character is part of the UCS Block '''
  2326.     ret = libxml2mod.xmlUCSIsBlock(code, block)
  2327.     return ret
  2328.  
  2329.  
  2330. def uCSIsBlockElements(code):
  2331.     '''Check whether the character is part of BlockElements UCS
  2332.        Block '''
  2333.     ret = libxml2mod.xmlUCSIsBlockElements(code)
  2334.     return ret
  2335.  
  2336.  
  2337. def uCSIsBopomofo(code):
  2338.     '''Check whether the character is part of Bopomofo UCS Block '''
  2339.     ret = libxml2mod.xmlUCSIsBopomofo(code)
  2340.     return ret
  2341.  
  2342.  
  2343. def uCSIsBopomofoExtended(code):
  2344.     '''Check whether the character is part of BopomofoExtended UCS
  2345.        Block '''
  2346.     ret = libxml2mod.xmlUCSIsBopomofoExtended(code)
  2347.     return ret
  2348.  
  2349.  
  2350. def uCSIsBoxDrawing(code):
  2351.     '''Check whether the character is part of BoxDrawing UCS Block '''
  2352.     ret = libxml2mod.xmlUCSIsBoxDrawing(code)
  2353.     return ret
  2354.  
  2355.  
  2356. def uCSIsBraillePatterns(code):
  2357.     '''Check whether the character is part of BraillePatterns UCS
  2358.        Block '''
  2359.     ret = libxml2mod.xmlUCSIsBraillePatterns(code)
  2360.     return ret
  2361.  
  2362.  
  2363. def uCSIsBuhid(code):
  2364.     '''Check whether the character is part of Buhid UCS Block '''
  2365.     ret = libxml2mod.xmlUCSIsBuhid(code)
  2366.     return ret
  2367.  
  2368.  
  2369. def uCSIsByzantineMusicalSymbols(code):
  2370.     '''Check whether the character is part of
  2371.        ByzantineMusicalSymbols UCS Block '''
  2372.     ret = libxml2mod.xmlUCSIsByzantineMusicalSymbols(code)
  2373.     return ret
  2374.  
  2375.  
  2376. def uCSIsCJKCompatibility(code):
  2377.     '''Check whether the character is part of CJKCompatibility UCS
  2378.        Block '''
  2379.     ret = libxml2mod.xmlUCSIsCJKCompatibility(code)
  2380.     return ret
  2381.  
  2382.  
  2383. def uCSIsCJKCompatibilityForms(code):
  2384.     '''Check whether the character is part of
  2385.        CJKCompatibilityForms UCS Block '''
  2386.     ret = libxml2mod.xmlUCSIsCJKCompatibilityForms(code)
  2387.     return ret
  2388.  
  2389.  
  2390. def uCSIsCJKCompatibilityIdeographs(code):
  2391.     '''Check whether the character is part of
  2392.        CJKCompatibilityIdeographs UCS Block '''
  2393.     ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographs(code)
  2394.     return ret
  2395.  
  2396.  
  2397. def uCSIsCJKCompatibilityIdeographsSupplement(code):
  2398.     '''Check whether the character is part of
  2399.        CJKCompatibilityIdeographsSupplement UCS Block '''
  2400.     ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographsSupplement(code)
  2401.     return ret
  2402.  
  2403.  
  2404. def uCSIsCJKRadicalsSupplement(code):
  2405.     '''Check whether the character is part of
  2406.        CJKRadicalsSupplement UCS Block '''
  2407.     ret = libxml2mod.xmlUCSIsCJKRadicalsSupplement(code)
  2408.     return ret
  2409.  
  2410.  
  2411. def uCSIsCJKSymbolsandPunctuation(code):
  2412.     '''Check whether the character is part of
  2413.        CJKSymbolsandPunctuation UCS Block '''
  2414.     ret = libxml2mod.xmlUCSIsCJKSymbolsandPunctuation(code)
  2415.     return ret
  2416.  
  2417.  
  2418. def uCSIsCJKUnifiedIdeographs(code):
  2419.     '''Check whether the character is part of CJKUnifiedIdeographs
  2420.        UCS Block '''
  2421.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographs(code)
  2422.     return ret
  2423.  
  2424.  
  2425. def uCSIsCJKUnifiedIdeographsExtensionA(code):
  2426.     '''Check whether the character is part of
  2427.        CJKUnifiedIdeographsExtensionA UCS Block '''
  2428.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionA(code)
  2429.     return ret
  2430.  
  2431.  
  2432. def uCSIsCJKUnifiedIdeographsExtensionB(code):
  2433.     '''Check whether the character is part of
  2434.        CJKUnifiedIdeographsExtensionB UCS Block '''
  2435.     ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionB(code)
  2436.     return ret
  2437.  
  2438.  
  2439. def uCSIsCat(code, cat):
  2440.     '''Check whether the character is part of the UCS Category '''
  2441.     ret = libxml2mod.xmlUCSIsCat(code, cat)
  2442.     return ret
  2443.  
  2444.  
  2445. def uCSIsCatC(code):
  2446.     '''Check whether the character is part of C UCS Category '''
  2447.     ret = libxml2mod.xmlUCSIsCatC(code)
  2448.     return ret
  2449.  
  2450.  
  2451. def uCSIsCatCc(code):
  2452.     '''Check whether the character is part of Cc UCS Category '''
  2453.     ret = libxml2mod.xmlUCSIsCatCc(code)
  2454.     return ret
  2455.  
  2456.  
  2457. def uCSIsCatCf(code):
  2458.     '''Check whether the character is part of Cf UCS Category '''
  2459.     ret = libxml2mod.xmlUCSIsCatCf(code)
  2460.     return ret
  2461.  
  2462.  
  2463. def uCSIsCatCo(code):
  2464.     '''Check whether the character is part of Co UCS Category '''
  2465.     ret = libxml2mod.xmlUCSIsCatCo(code)
  2466.     return ret
  2467.  
  2468.  
  2469. def uCSIsCatCs(code):
  2470.     '''Check whether the character is part of Cs UCS Category '''
  2471.     ret = libxml2mod.xmlUCSIsCatCs(code)
  2472.     return ret
  2473.  
  2474.  
  2475. def uCSIsCatL(code):
  2476.     '''Check whether the character is part of L UCS Category '''
  2477.     ret = libxml2mod.xmlUCSIsCatL(code)
  2478.     return ret
  2479.  
  2480.  
  2481. def uCSIsCatLl(code):
  2482.     '''Check whether the character is part of Ll UCS Category '''
  2483.     ret = libxml2mod.xmlUCSIsCatLl(code)
  2484.     return ret
  2485.  
  2486.  
  2487. def uCSIsCatLm(code):
  2488.     '''Check whether the character is part of Lm UCS Category '''
  2489.     ret = libxml2mod.xmlUCSIsCatLm(code)
  2490.     return ret
  2491.  
  2492.  
  2493. def uCSIsCatLo(code):
  2494.     '''Check whether the character is part of Lo UCS Category '''
  2495.     ret = libxml2mod.xmlUCSIsCatLo(code)
  2496.     return ret
  2497.  
  2498.  
  2499. def uCSIsCatLt(code):
  2500.     '''Check whether the character is part of Lt UCS Category '''
  2501.     ret = libxml2mod.xmlUCSIsCatLt(code)
  2502.     return ret
  2503.  
  2504.  
  2505. def uCSIsCatLu(code):
  2506.     '''Check whether the character is part of Lu UCS Category '''
  2507.     ret = libxml2mod.xmlUCSIsCatLu(code)
  2508.     return ret
  2509.  
  2510.  
  2511. def uCSIsCatM(code):
  2512.     '''Check whether the character is part of M UCS Category '''
  2513.     ret = libxml2mod.xmlUCSIsCatM(code)
  2514.     return ret
  2515.  
  2516.  
  2517. def uCSIsCatMc(code):
  2518.     '''Check whether the character is part of Mc UCS Category '''
  2519.     ret = libxml2mod.xmlUCSIsCatMc(code)
  2520.     return ret
  2521.  
  2522.  
  2523. def uCSIsCatMe(code):
  2524.     '''Check whether the character is part of Me UCS Category '''
  2525.     ret = libxml2mod.xmlUCSIsCatMe(code)
  2526.     return ret
  2527.  
  2528.  
  2529. def uCSIsCatMn(code):
  2530.     '''Check whether the character is part of Mn UCS Category '''
  2531.     ret = libxml2mod.xmlUCSIsCatMn(code)
  2532.     return ret
  2533.  
  2534.  
  2535. def uCSIsCatN(code):
  2536.     '''Check whether the character is part of N UCS Category '''
  2537.     ret = libxml2mod.xmlUCSIsCatN(code)
  2538.     return ret
  2539.  
  2540.  
  2541. def uCSIsCatNd(code):
  2542.     '''Check whether the character is part of Nd UCS Category '''
  2543.     ret = libxml2mod.xmlUCSIsCatNd(code)
  2544.     return ret
  2545.  
  2546.  
  2547. def uCSIsCatNl(code):
  2548.     '''Check whether the character is part of Nl UCS Category '''
  2549.     ret = libxml2mod.xmlUCSIsCatNl(code)
  2550.     return ret
  2551.  
  2552.  
  2553. def uCSIsCatNo(code):
  2554.     '''Check whether the character is part of No UCS Category '''
  2555.     ret = libxml2mod.xmlUCSIsCatNo(code)
  2556.     return ret
  2557.  
  2558.  
  2559. def uCSIsCatP(code):
  2560.     '''Check whether the character is part of P UCS Category '''
  2561.     ret = libxml2mod.xmlUCSIsCatP(code)
  2562.     return ret
  2563.  
  2564.  
  2565. def uCSIsCatPc(code):
  2566.     '''Check whether the character is part of Pc UCS Category '''
  2567.     ret = libxml2mod.xmlUCSIsCatPc(code)
  2568.     return ret
  2569.  
  2570.  
  2571. def uCSIsCatPd(code):
  2572.     '''Check whether the character is part of Pd UCS Category '''
  2573.     ret = libxml2mod.xmlUCSIsCatPd(code)
  2574.     return ret
  2575.  
  2576.  
  2577. def uCSIsCatPe(code):
  2578.     '''Check whether the character is part of Pe UCS Category '''
  2579.     ret = libxml2mod.xmlUCSIsCatPe(code)
  2580.     return ret
  2581.  
  2582.  
  2583. def uCSIsCatPf(code):
  2584.     '''Check whether the character is part of Pf UCS Category '''
  2585.     ret = libxml2mod.xmlUCSIsCatPf(code)
  2586.     return ret
  2587.  
  2588.  
  2589. def uCSIsCatPi(code):
  2590.     '''Check whether the character is part of Pi UCS Category '''
  2591.     ret = libxml2mod.xmlUCSIsCatPi(code)
  2592.     return ret
  2593.  
  2594.  
  2595. def uCSIsCatPo(code):
  2596.     '''Check whether the character is part of Po UCS Category '''
  2597.     ret = libxml2mod.xmlUCSIsCatPo(code)
  2598.     return ret
  2599.  
  2600.  
  2601. def uCSIsCatPs(code):
  2602.     '''Check whether the character is part of Ps UCS Category '''
  2603.     ret = libxml2mod.xmlUCSIsCatPs(code)
  2604.     return ret
  2605.  
  2606.  
  2607. def uCSIsCatS(code):
  2608.     '''Check whether the character is part of S UCS Category '''
  2609.     ret = libxml2mod.xmlUCSIsCatS(code)
  2610.     return ret
  2611.  
  2612.  
  2613. def uCSIsCatSc(code):
  2614.     '''Check whether the character is part of Sc UCS Category '''
  2615.     ret = libxml2mod.xmlUCSIsCatSc(code)
  2616.     return ret
  2617.  
  2618.  
  2619. def uCSIsCatSk(code):
  2620.     '''Check whether the character is part of Sk UCS Category '''
  2621.     ret = libxml2mod.xmlUCSIsCatSk(code)
  2622.     return ret
  2623.  
  2624.  
  2625. def uCSIsCatSm(code):
  2626.     '''Check whether the character is part of Sm UCS Category '''
  2627.     ret = libxml2mod.xmlUCSIsCatSm(code)
  2628.     return ret
  2629.  
  2630.  
  2631. def uCSIsCatSo(code):
  2632.     '''Check whether the character is part of So UCS Category '''
  2633.     ret = libxml2mod.xmlUCSIsCatSo(code)
  2634.     return ret
  2635.  
  2636.  
  2637. def uCSIsCatZ(code):
  2638.     '''Check whether the character is part of Z UCS Category '''
  2639.     ret = libxml2mod.xmlUCSIsCatZ(code)
  2640.     return ret
  2641.  
  2642.  
  2643. def uCSIsCatZl(code):
  2644.     '''Check whether the character is part of Zl UCS Category '''
  2645.     ret = libxml2mod.xmlUCSIsCatZl(code)
  2646.     return ret
  2647.  
  2648.  
  2649. def uCSIsCatZp(code):
  2650.     '''Check whether the character is part of Zp UCS Category '''
  2651.     ret = libxml2mod.xmlUCSIsCatZp(code)
  2652.     return ret
  2653.  
  2654.  
  2655. def uCSIsCatZs(code):
  2656.     '''Check whether the character is part of Zs UCS Category '''
  2657.     ret = libxml2mod.xmlUCSIsCatZs(code)
  2658.     return ret
  2659.  
  2660.  
  2661. def uCSIsCherokee(code):
  2662.     '''Check whether the character is part of Cherokee UCS Block '''
  2663.     ret = libxml2mod.xmlUCSIsCherokee(code)
  2664.     return ret
  2665.  
  2666.  
  2667. def uCSIsCombiningDiacriticalMarks(code):
  2668.     '''Check whether the character is part of
  2669.        CombiningDiacriticalMarks UCS Block '''
  2670.     ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarks(code)
  2671.     return ret
  2672.  
  2673.  
  2674. def uCSIsCombiningDiacriticalMarksforSymbols(code):
  2675.     '''Check whether the character is part of
  2676.        CombiningDiacriticalMarksforSymbols UCS Block '''
  2677.     ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarksforSymbols(code)
  2678.     return ret
  2679.  
  2680.  
  2681. def uCSIsCombiningHalfMarks(code):
  2682.     '''Check whether the character is part of CombiningHalfMarks
  2683.        UCS Block '''
  2684.     ret = libxml2mod.xmlUCSIsCombiningHalfMarks(code)
  2685.     return ret
  2686.  
  2687.  
  2688. def uCSIsCombiningMarksforSymbols(code):
  2689.     '''Check whether the character is part of
  2690.        CombiningMarksforSymbols UCS Block '''
  2691.     ret = libxml2mod.xmlUCSIsCombiningMarksforSymbols(code)
  2692.     return ret
  2693.  
  2694.  
  2695. def uCSIsControlPictures(code):
  2696.     '''Check whether the character is part of ControlPictures UCS
  2697.        Block '''
  2698.     ret = libxml2mod.xmlUCSIsControlPictures(code)
  2699.     return ret
  2700.  
  2701.  
  2702. def uCSIsCurrencySymbols(code):
  2703.     '''Check whether the character is part of CurrencySymbols UCS
  2704.        Block '''
  2705.     ret = libxml2mod.xmlUCSIsCurrencySymbols(code)
  2706.     return ret
  2707.  
  2708.  
  2709. def uCSIsCypriotSyllabary(code):
  2710.     '''Check whether the character is part of CypriotSyllabary UCS
  2711.        Block '''
  2712.     ret = libxml2mod.xmlUCSIsCypriotSyllabary(code)
  2713.     return ret
  2714.  
  2715.  
  2716. def uCSIsCyrillic(code):
  2717.     '''Check whether the character is part of Cyrillic UCS Block '''
  2718.     ret = libxml2mod.xmlUCSIsCyrillic(code)
  2719.     return ret
  2720.  
  2721.  
  2722. def uCSIsCyrillicSupplement(code):
  2723.     '''Check whether the character is part of CyrillicSupplement
  2724.        UCS Block '''
  2725.     ret = libxml2mod.xmlUCSIsCyrillicSupplement(code)
  2726.     return ret
  2727.  
  2728.  
  2729. def uCSIsDeseret(code):
  2730.     '''Check whether the character is part of Deseret UCS Block '''
  2731.     ret = libxml2mod.xmlUCSIsDeseret(code)
  2732.     return ret
  2733.  
  2734.  
  2735. def uCSIsDevanagari(code):
  2736.     '''Check whether the character is part of Devanagari UCS Block '''
  2737.     ret = libxml2mod.xmlUCSIsDevanagari(code)
  2738.     return ret
  2739.  
  2740.  
  2741. def uCSIsDingbats(code):
  2742.     '''Check whether the character is part of Dingbats UCS Block '''
  2743.     ret = libxml2mod.xmlUCSIsDingbats(code)
  2744.     return ret
  2745.  
  2746.  
  2747. def uCSIsEnclosedAlphanumerics(code):
  2748.     '''Check whether the character is part of
  2749.        EnclosedAlphanumerics UCS Block '''
  2750.     ret = libxml2mod.xmlUCSIsEnclosedAlphanumerics(code)
  2751.     return ret
  2752.  
  2753.  
  2754. def uCSIsEnclosedCJKLettersandMonths(code):
  2755.     '''Check whether the character is part of
  2756.        EnclosedCJKLettersandMonths UCS Block '''
  2757.     ret = libxml2mod.xmlUCSIsEnclosedCJKLettersandMonths(code)
  2758.     return ret
  2759.  
  2760.  
  2761. def uCSIsEthiopic(code):
  2762.     '''Check whether the character is part of Ethiopic UCS Block '''
  2763.     ret = libxml2mod.xmlUCSIsEthiopic(code)
  2764.     return ret
  2765.  
  2766.  
  2767. def uCSIsGeneralPunctuation(code):
  2768.     '''Check whether the character is part of GeneralPunctuation
  2769.        UCS Block '''
  2770.     ret = libxml2mod.xmlUCSIsGeneralPunctuation(code)
  2771.     return ret
  2772.  
  2773.  
  2774. def uCSIsGeometricShapes(code):
  2775.     '''Check whether the character is part of GeometricShapes UCS
  2776.        Block '''
  2777.     ret = libxml2mod.xmlUCSIsGeometricShapes(code)
  2778.     return ret
  2779.  
  2780.  
  2781. def uCSIsGeorgian(code):
  2782.     '''Check whether the character is part of Georgian UCS Block '''
  2783.     ret = libxml2mod.xmlUCSIsGeorgian(code)
  2784.     return ret
  2785.  
  2786.  
  2787. def uCSIsGothic(code):
  2788.     '''Check whether the character is part of Gothic UCS Block '''
  2789.     ret = libxml2mod.xmlUCSIsGothic(code)
  2790.     return ret
  2791.  
  2792.  
  2793. def uCSIsGreek(code):
  2794.     '''Check whether the character is part of Greek UCS Block '''
  2795.     ret = libxml2mod.xmlUCSIsGreek(code)
  2796.     return ret
  2797.  
  2798.  
  2799. def uCSIsGreekExtended(code):
  2800.     '''Check whether the character is part of GreekExtended UCS
  2801.        Block '''
  2802.     ret = libxml2mod.xmlUCSIsGreekExtended(code)
  2803.     return ret
  2804.  
  2805.  
  2806. def uCSIsGreekandCoptic(code):
  2807.     '''Check whether the character is part of GreekandCoptic UCS
  2808.        Block '''
  2809.     ret = libxml2mod.xmlUCSIsGreekandCoptic(code)
  2810.     return ret
  2811.  
  2812.  
  2813. def uCSIsGujarati(code):
  2814.     '''Check whether the character is part of Gujarati UCS Block '''
  2815.     ret = libxml2mod.xmlUCSIsGujarati(code)
  2816.     return ret
  2817.  
  2818.  
  2819. def uCSIsGurmukhi(code):
  2820.     '''Check whether the character is part of Gurmukhi UCS Block '''
  2821.     ret = libxml2mod.xmlUCSIsGurmukhi(code)
  2822.     return ret
  2823.  
  2824.  
  2825. def uCSIsHalfwidthandFullwidthForms(code):
  2826.     '''Check whether the character is part of
  2827.        HalfwidthandFullwidthForms UCS Block '''
  2828.     ret = libxml2mod.xmlUCSIsHalfwidthandFullwidthForms(code)
  2829.     return ret
  2830.  
  2831.  
  2832. def uCSIsHangulCompatibilityJamo(code):
  2833.     '''Check whether the character is part of
  2834.        HangulCompatibilityJamo UCS Block '''
  2835.     ret = libxml2mod.xmlUCSIsHangulCompatibilityJamo(code)
  2836.     return ret
  2837.  
  2838.  
  2839. def uCSIsHangulJamo(code):
  2840.     '''Check whether the character is part of HangulJamo UCS Block '''
  2841.     ret = libxml2mod.xmlUCSIsHangulJamo(code)
  2842.     return ret
  2843.  
  2844.  
  2845. def uCSIsHangulSyllables(code):
  2846.     '''Check whether the character is part of HangulSyllables UCS
  2847.        Block '''
  2848.     ret = libxml2mod.xmlUCSIsHangulSyllables(code)
  2849.     return ret
  2850.  
  2851.  
  2852. def uCSIsHanunoo(code):
  2853.     '''Check whether the character is part of Hanunoo UCS Block '''
  2854.     ret = libxml2mod.xmlUCSIsHanunoo(code)
  2855.     return ret
  2856.  
  2857.  
  2858. def uCSIsHebrew(code):
  2859.     '''Check whether the character is part of Hebrew UCS Block '''
  2860.     ret = libxml2mod.xmlUCSIsHebrew(code)
  2861.     return ret
  2862.  
  2863.  
  2864. def uCSIsHighPrivateUseSurrogates(code):
  2865.     '''Check whether the character is part of
  2866.        HighPrivateUseSurrogates UCS Block '''
  2867.     ret = libxml2mod.xmlUCSIsHighPrivateUseSurrogates(code)
  2868.     return ret
  2869.  
  2870.  
  2871. def uCSIsHighSurrogates(code):
  2872.     '''Check whether the character is part of HighSurrogates UCS
  2873.        Block '''
  2874.     ret = libxml2mod.xmlUCSIsHighSurrogates(code)
  2875.     return ret
  2876.  
  2877.  
  2878. def uCSIsHiragana(code):
  2879.     '''Check whether the character is part of Hiragana UCS Block '''
  2880.     ret = libxml2mod.xmlUCSIsHiragana(code)
  2881.     return ret
  2882.  
  2883.  
  2884. def uCSIsIPAExtensions(code):
  2885.     '''Check whether the character is part of IPAExtensions UCS
  2886.        Block '''
  2887.     ret = libxml2mod.xmlUCSIsIPAExtensions(code)
  2888.     return ret
  2889.  
  2890.  
  2891. def uCSIsIdeographicDescriptionCharacters(code):
  2892.     '''Check whether the character is part of
  2893.        IdeographicDescriptionCharacters UCS Block '''
  2894.     ret = libxml2mod.xmlUCSIsIdeographicDescriptionCharacters(code)
  2895.     return ret
  2896.  
  2897.  
  2898. def uCSIsKanbun(code):
  2899.     '''Check whether the character is part of Kanbun UCS Block '''
  2900.     ret = libxml2mod.xmlUCSIsKanbun(code)
  2901.     return ret
  2902.  
  2903.  
  2904. def uCSIsKangxiRadicals(code):
  2905.     '''Check whether the character is part of KangxiRadicals UCS
  2906.        Block '''
  2907.     ret = libxml2mod.xmlUCSIsKangxiRadicals(code)
  2908.     return ret
  2909.  
  2910.  
  2911. def uCSIsKannada(code):
  2912.     '''Check whether the character is part of Kannada UCS Block '''
  2913.     ret = libxml2mod.xmlUCSIsKannada(code)
  2914.     return ret
  2915.  
  2916.  
  2917. def uCSIsKatakana(code):
  2918.     '''Check whether the character is part of Katakana UCS Block '''
  2919.     ret = libxml2mod.xmlUCSIsKatakana(code)
  2920.     return ret
  2921.  
  2922.  
  2923. def uCSIsKatakanaPhoneticExtensions(code):
  2924.     '''Check whether the character is part of
  2925.        KatakanaPhoneticExtensions UCS Block '''
  2926.     ret = libxml2mod.xmlUCSIsKatakanaPhoneticExtensions(code)
  2927.     return ret
  2928.  
  2929.  
  2930. def uCSIsKhmer(code):
  2931.     '''Check whether the character is part of Khmer UCS Block '''
  2932.     ret = libxml2mod.xmlUCSIsKhmer(code)
  2933.     return ret
  2934.  
  2935.  
  2936. def uCSIsKhmerSymbols(code):
  2937.     '''Check whether the character is part of KhmerSymbols UCS
  2938.        Block '''
  2939.     ret = libxml2mod.xmlUCSIsKhmerSymbols(code)
  2940.     return ret
  2941.  
  2942.  
  2943. def uCSIsLao(code):
  2944.     '''Check whether the character is part of Lao UCS Block '''
  2945.     ret = libxml2mod.xmlUCSIsLao(code)
  2946.     return ret
  2947.  
  2948.  
  2949. def uCSIsLatin1Supplement(code):
  2950.     '''Check whether the character is part of Latin-1Supplement
  2951.        UCS Block '''
  2952.     ret = libxml2mod.xmlUCSIsLatin1Supplement(code)
  2953.     return ret
  2954.  
  2955.  
  2956. def uCSIsLatinExtendedA(code):
  2957.     '''Check whether the character is part of LatinExtended-A UCS
  2958.        Block '''
  2959.     ret = libxml2mod.xmlUCSIsLatinExtendedA(code)
  2960.     return ret
  2961.  
  2962.  
  2963. def uCSIsLatinExtendedAdditional(code):
  2964.     '''Check whether the character is part of
  2965.        LatinExtendedAdditional UCS Block '''
  2966.     ret = libxml2mod.xmlUCSIsLatinExtendedAdditional(code)
  2967.     return ret
  2968.  
  2969.  
  2970. def uCSIsLatinExtendedB(code):
  2971.     '''Check whether the character is part of LatinExtended-B UCS
  2972.        Block '''
  2973.     ret = libxml2mod.xmlUCSIsLatinExtendedB(code)
  2974.     return ret
  2975.  
  2976.  
  2977. def uCSIsLetterlikeSymbols(code):
  2978.     '''Check whether the character is part of LetterlikeSymbols
  2979.        UCS Block '''
  2980.     ret = libxml2mod.xmlUCSIsLetterlikeSymbols(code)
  2981.     return ret
  2982.  
  2983.  
  2984. def uCSIsLimbu(code):
  2985.     '''Check whether the character is part of Limbu UCS Block '''
  2986.     ret = libxml2mod.xmlUCSIsLimbu(code)
  2987.     return ret
  2988.  
  2989.  
  2990. def uCSIsLinearBIdeograms(code):
  2991.     '''Check whether the character is part of LinearBIdeograms UCS
  2992.        Block '''
  2993.     ret = libxml2mod.xmlUCSIsLinearBIdeograms(code)
  2994.     return ret
  2995.  
  2996.  
  2997. def uCSIsLinearBSyllabary(code):
  2998.     '''Check whether the character is part of LinearBSyllabary UCS
  2999.        Block '''
  3000.     ret = libxml2mod.xmlUCSIsLinearBSyllabary(code)
  3001.     return ret
  3002.  
  3003.  
  3004. def uCSIsLowSurrogates(code):
  3005.     '''Check whether the character is part of LowSurrogates UCS
  3006.        Block '''
  3007.     ret = libxml2mod.xmlUCSIsLowSurrogates(code)
  3008.     return ret
  3009.  
  3010.  
  3011. def uCSIsMalayalam(code):
  3012.     '''Check whether the character is part of Malayalam UCS Block '''
  3013.     ret = libxml2mod.xmlUCSIsMalayalam(code)
  3014.     return ret
  3015.  
  3016.  
  3017. def uCSIsMathematicalAlphanumericSymbols(code):
  3018.     '''Check whether the character is part of
  3019.        MathematicalAlphanumericSymbols UCS Block '''
  3020.     ret = libxml2mod.xmlUCSIsMathematicalAlphanumericSymbols(code)
  3021.     return ret
  3022.  
  3023.  
  3024. def uCSIsMathematicalOperators(code):
  3025.     '''Check whether the character is part of
  3026.        MathematicalOperators UCS Block '''
  3027.     ret = libxml2mod.xmlUCSIsMathematicalOperators(code)
  3028.     return ret
  3029.  
  3030.  
  3031. def uCSIsMiscellaneousMathematicalSymbolsA(code):
  3032.     '''Check whether the character is part of
  3033.        MiscellaneousMathematicalSymbols-A UCS Block '''
  3034.     ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsA(code)
  3035.     return ret
  3036.  
  3037.  
  3038. def uCSIsMiscellaneousMathematicalSymbolsB(code):
  3039.     '''Check whether the character is part of
  3040.        MiscellaneousMathematicalSymbols-B UCS Block '''
  3041.     ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsB(code)
  3042.     return ret
  3043.  
  3044.  
  3045. def uCSIsMiscellaneousSymbols(code):
  3046.     '''Check whether the character is part of MiscellaneousSymbols
  3047.        UCS Block '''
  3048.     ret = libxml2mod.xmlUCSIsMiscellaneousSymbols(code)
  3049.     return ret
  3050.  
  3051.  
  3052. def uCSIsMiscellaneousSymbolsandArrows(code):
  3053.     '''Check whether the character is part of
  3054.        MiscellaneousSymbolsandArrows UCS Block '''
  3055.     ret = libxml2mod.xmlUCSIsMiscellaneousSymbolsandArrows(code)
  3056.     return ret
  3057.  
  3058.  
  3059. def uCSIsMiscellaneousTechnical(code):
  3060.     '''Check whether the character is part of
  3061.        MiscellaneousTechnical UCS Block '''
  3062.     ret = libxml2mod.xmlUCSIsMiscellaneousTechnical(code)
  3063.     return ret
  3064.  
  3065.  
  3066. def uCSIsMongolian(code):
  3067.     '''Check whether the character is part of Mongolian UCS Block '''
  3068.     ret = libxml2mod.xmlUCSIsMongolian(code)
  3069.     return ret
  3070.  
  3071.  
  3072. def uCSIsMusicalSymbols(code):
  3073.     '''Check whether the character is part of MusicalSymbols UCS
  3074.        Block '''
  3075.     ret = libxml2mod.xmlUCSIsMusicalSymbols(code)
  3076.     return ret
  3077.  
  3078.  
  3079. def uCSIsMyanmar(code):
  3080.     '''Check whether the character is part of Myanmar UCS Block '''
  3081.     ret = libxml2mod.xmlUCSIsMyanmar(code)
  3082.     return ret
  3083.  
  3084.  
  3085. def uCSIsNumberForms(code):
  3086.     '''Check whether the character is part of NumberForms UCS Block '''
  3087.     ret = libxml2mod.xmlUCSIsNumberForms(code)
  3088.     return ret
  3089.  
  3090.  
  3091. def uCSIsOgham(code):
  3092.     '''Check whether the character is part of Ogham UCS Block '''
  3093.     ret = libxml2mod.xmlUCSIsOgham(code)
  3094.     return ret
  3095.  
  3096.  
  3097. def uCSIsOldItalic(code):
  3098.     '''Check whether the character is part of OldItalic UCS Block '''
  3099.     ret = libxml2mod.xmlUCSIsOldItalic(code)
  3100.     return ret
  3101.  
  3102.  
  3103. def uCSIsOpticalCharacterRecognition(code):
  3104.     '''Check whether the character is part of
  3105.        OpticalCharacterRecognition UCS Block '''
  3106.     ret = libxml2mod.xmlUCSIsOpticalCharacterRecognition(code)
  3107.     return ret
  3108.  
  3109.  
  3110. def uCSIsOriya(code):
  3111.     '''Check whether the character is part of Oriya UCS Block '''
  3112.     ret = libxml2mod.xmlUCSIsOriya(code)
  3113.     return ret
  3114.  
  3115.  
  3116. def uCSIsOsmanya(code):
  3117.     '''Check whether the character is part of Osmanya UCS Block '''
  3118.     ret = libxml2mod.xmlUCSIsOsmanya(code)
  3119.     return ret
  3120.  
  3121.  
  3122. def uCSIsPhoneticExtensions(code):
  3123.     '''Check whether the character is part of PhoneticExtensions
  3124.        UCS Block '''
  3125.     ret = libxml2mod.xmlUCSIsPhoneticExtensions(code)
  3126.     return ret
  3127.  
  3128.  
  3129. def uCSIsPrivateUse(code):
  3130.     '''Check whether the character is part of PrivateUse UCS Block '''
  3131.     ret = libxml2mod.xmlUCSIsPrivateUse(code)
  3132.     return ret
  3133.  
  3134.  
  3135. def uCSIsPrivateUseArea(code):
  3136.     '''Check whether the character is part of PrivateUseArea UCS
  3137.        Block '''
  3138.     ret = libxml2mod.xmlUCSIsPrivateUseArea(code)
  3139.     return ret
  3140.  
  3141.  
  3142. def uCSIsRunic(code):
  3143.     '''Check whether the character is part of Runic UCS Block '''
  3144.     ret = libxml2mod.xmlUCSIsRunic(code)
  3145.     return ret
  3146.  
  3147.  
  3148. def uCSIsShavian(code):
  3149.     '''Check whether the character is part of Shavian UCS Block '''
  3150.     ret = libxml2mod.xmlUCSIsShavian(code)
  3151.     return ret
  3152.  
  3153.  
  3154. def uCSIsSinhala(code):
  3155.     '''Check whether the character is part of Sinhala UCS Block '''
  3156.     ret = libxml2mod.xmlUCSIsSinhala(code)
  3157.     return ret
  3158.  
  3159.  
  3160. def uCSIsSmallFormVariants(code):
  3161.     '''Check whether the character is part of SmallFormVariants
  3162.        UCS Block '''
  3163.     ret = libxml2mod.xmlUCSIsSmallFormVariants(code)
  3164.     return ret
  3165.  
  3166.  
  3167. def uCSIsSpacingModifierLetters(code):
  3168.     '''Check whether the character is part of
  3169.        SpacingModifierLetters UCS Block '''
  3170.     ret = libxml2mod.xmlUCSIsSpacingModifierLetters(code)
  3171.     return ret
  3172.  
  3173.  
  3174. def uCSIsSpecials(code):
  3175.     '''Check whether the character is part of Specials UCS Block '''
  3176.     ret = libxml2mod.xmlUCSIsSpecials(code)
  3177.     return ret
  3178.  
  3179.  
  3180. def uCSIsSuperscriptsandSubscripts(code):
  3181.     '''Check whether the character is part of
  3182.        SuperscriptsandSubscripts UCS Block '''
  3183.     ret = libxml2mod.xmlUCSIsSuperscriptsandSubscripts(code)
  3184.     return ret
  3185.  
  3186.  
  3187. def uCSIsSupplementalArrowsA(code):
  3188.     '''Check whether the character is part of SupplementalArrows-A
  3189.        UCS Block '''
  3190.     ret = libxml2mod.xmlUCSIsSupplementalArrowsA(code)
  3191.     return ret
  3192.  
  3193.  
  3194. def uCSIsSupplementalArrowsB(code):
  3195.     '''Check whether the character is part of SupplementalArrows-B
  3196.        UCS Block '''
  3197.     ret = libxml2mod.xmlUCSIsSupplementalArrowsB(code)
  3198.     return ret
  3199.  
  3200.  
  3201. def uCSIsSupplementalMathematicalOperators(code):
  3202.     '''Check whether the character is part of
  3203.        SupplementalMathematicalOperators UCS Block '''
  3204.     ret = libxml2mod.xmlUCSIsSupplementalMathematicalOperators(code)
  3205.     return ret
  3206.  
  3207.  
  3208. def uCSIsSupplementaryPrivateUseAreaA(code):
  3209.     '''Check whether the character is part of
  3210.        SupplementaryPrivateUseArea-A UCS Block '''
  3211.     ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaA(code)
  3212.     return ret
  3213.  
  3214.  
  3215. def uCSIsSupplementaryPrivateUseAreaB(code):
  3216.     '''Check whether the character is part of
  3217.        SupplementaryPrivateUseArea-B UCS Block '''
  3218.     ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaB(code)
  3219.     return ret
  3220.  
  3221.  
  3222. def uCSIsSyriac(code):
  3223.     '''Check whether the character is part of Syriac UCS Block '''
  3224.     ret = libxml2mod.xmlUCSIsSyriac(code)
  3225.     return ret
  3226.  
  3227.  
  3228. def uCSIsTagalog(code):
  3229.     '''Check whether the character is part of Tagalog UCS Block '''
  3230.     ret = libxml2mod.xmlUCSIsTagalog(code)
  3231.     return ret
  3232.  
  3233.  
  3234. def uCSIsTagbanwa(code):
  3235.     '''Check whether the character is part of Tagbanwa UCS Block '''
  3236.     ret = libxml2mod.xmlUCSIsTagbanwa(code)
  3237.     return ret
  3238.  
  3239.  
  3240. def uCSIsTags(code):
  3241.     '''Check whether the character is part of Tags UCS Block '''
  3242.     ret = libxml2mod.xmlUCSIsTags(code)
  3243.     return ret
  3244.  
  3245.  
  3246. def uCSIsTaiLe(code):
  3247.     '''Check whether the character is part of TaiLe UCS Block '''
  3248.     ret = libxml2mod.xmlUCSIsTaiLe(code)
  3249.     return ret
  3250.  
  3251.  
  3252. def uCSIsTaiXuanJingSymbols(code):
  3253.     '''Check whether the character is part of TaiXuanJingSymbols
  3254.        UCS Block '''
  3255.     ret = libxml2mod.xmlUCSIsTaiXuanJingSymbols(code)
  3256.     return ret
  3257.  
  3258.  
  3259. def uCSIsTamil(code):
  3260.     '''Check whether the character is part of Tamil UCS Block '''
  3261.     ret = libxml2mod.xmlUCSIsTamil(code)
  3262.     return ret
  3263.  
  3264.  
  3265. def uCSIsTelugu(code):
  3266.     '''Check whether the character is part of Telugu UCS Block '''
  3267.     ret = libxml2mod.xmlUCSIsTelugu(code)
  3268.     return ret
  3269.  
  3270.  
  3271. def uCSIsThaana(code):
  3272.     '''Check whether the character is part of Thaana UCS Block '''
  3273.     ret = libxml2mod.xmlUCSIsThaana(code)
  3274.     return ret
  3275.  
  3276.  
  3277. def uCSIsThai(code):
  3278.     '''Check whether the character is part of Thai UCS Block '''
  3279.     ret = libxml2mod.xmlUCSIsThai(code)
  3280.     return ret
  3281.  
  3282.  
  3283. def uCSIsTibetan(code):
  3284.     '''Check whether the character is part of Tibetan UCS Block '''
  3285.     ret = libxml2mod.xmlUCSIsTibetan(code)
  3286.     return ret
  3287.  
  3288.  
  3289. def uCSIsUgaritic(code):
  3290.     '''Check whether the character is part of Ugaritic UCS Block '''
  3291.     ret = libxml2mod.xmlUCSIsUgaritic(code)
  3292.     return ret
  3293.  
  3294.  
  3295. def uCSIsUnifiedCanadianAboriginalSyllabics(code):
  3296.     '''Check whether the character is part of
  3297.        UnifiedCanadianAboriginalSyllabics UCS Block '''
  3298.     ret = libxml2mod.xmlUCSIsUnifiedCanadianAboriginalSyllabics(code)
  3299.     return ret
  3300.  
  3301.  
  3302. def uCSIsVariationSelectors(code):
  3303.     '''Check whether the character is part of VariationSelectors
  3304.        UCS Block '''
  3305.     ret = libxml2mod.xmlUCSIsVariationSelectors(code)
  3306.     return ret
  3307.  
  3308.  
  3309. def uCSIsVariationSelectorsSupplement(code):
  3310.     '''Check whether the character is part of
  3311.        VariationSelectorsSupplement UCS Block '''
  3312.     ret = libxml2mod.xmlUCSIsVariationSelectorsSupplement(code)
  3313.     return ret
  3314.  
  3315.  
  3316. def uCSIsYiRadicals(code):
  3317.     '''Check whether the character is part of YiRadicals UCS Block '''
  3318.     ret = libxml2mod.xmlUCSIsYiRadicals(code)
  3319.     return ret
  3320.  
  3321.  
  3322. def uCSIsYiSyllables(code):
  3323.     '''Check whether the character is part of YiSyllables UCS Block '''
  3324.     ret = libxml2mod.xmlUCSIsYiSyllables(code)
  3325.     return ret
  3326.  
  3327.  
  3328. def uCSIsYijingHexagramSymbols(code):
  3329.     '''Check whether the character is part of
  3330.        YijingHexagramSymbols UCS Block '''
  3331.     ret = libxml2mod.xmlUCSIsYijingHexagramSymbols(code)
  3332.     return ret
  3333.  
  3334.  
  3335. def checkVersion(version):
  3336.     '''check the compiled lib version against the include one.
  3337.        This can warn or immediately kill the application '''
  3338.     libxml2mod.xmlCheckVersion(version)
  3339.  
  3340.  
  3341. def valuePop(ctxt):
  3342.     '''Pops the top XPath object from the value stack '''
  3343.     if ctxt is None:
  3344.         ctxt__o = None
  3345.     else:
  3346.         ctxt__o = ctxt._o
  3347.     ret = libxml2mod.valuePop(ctxt__o)
  3348.     return ret
  3349.  
  3350.  
  3351. class xmlNode(xmlCore):
  3352.     
  3353.     def __init__(self, _obj = None):
  3354.         if type(_obj).__name__ != 'PyCObject':
  3355.             raise TypeError, 'xmlNode needs a PyCObject argument'
  3356.         type(_obj).__name__ != 'PyCObject'
  3357.         self._o = _obj
  3358.         xmlCore.__init__(self, _obj = _obj)
  3359.  
  3360.     
  3361.     def __repr__(self):
  3362.         return '<xmlNode (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  3363.  
  3364.     
  3365.     def ns(self):
  3366.         '''Get the namespace of a node '''
  3367.         ret = libxml2mod.xmlNodeGetNs(self._o)
  3368.         if ret is None:
  3369.             return None
  3370.         _xmlNode__tmp = xmlNs(_obj = ret)
  3371.         return _xmlNode__tmp
  3372.  
  3373.     
  3374.     def nsDefs(self):
  3375.         '''Get the namespace of a node '''
  3376.         ret = libxml2mod.xmlNodeGetNsDefs(self._o)
  3377.         if ret is None:
  3378.             return None
  3379.         _xmlNode__tmp = xmlNs(_obj = ret)
  3380.         return _xmlNode__tmp
  3381.  
  3382.     
  3383.     def debugDumpNode(self, output, depth):
  3384.         '''Dumps debug information for the element node, it is
  3385.            recursive '''
  3386.         libxml2mod.xmlDebugDumpNode(output, self._o, depth)
  3387.  
  3388.     
  3389.     def debugDumpNodeList(self, output, depth):
  3390.         '''Dumps debug information for the list of element node, it is
  3391.            recursive '''
  3392.         libxml2mod.xmlDebugDumpNodeList(output, self._o, depth)
  3393.  
  3394.     
  3395.     def debugDumpOneNode(self, output, depth):
  3396.         '''Dumps debug information for the element node, it is not
  3397.            recursive '''
  3398.         libxml2mod.xmlDebugDumpOneNode(output, self._o, depth)
  3399.  
  3400.     
  3401.     def lsCountNode(self):
  3402.         '''Count the children of @node. '''
  3403.         ret = libxml2mod.xmlLsCountNode(self._o)
  3404.         return ret
  3405.  
  3406.     
  3407.     def lsOneNode(self, output):
  3408.         '''Dump to @output the type and name of @node. '''
  3409.         libxml2mod.xmlLsOneNode(output, self._o)
  3410.  
  3411.     
  3412.     def shellPrintNode(self):
  3413.         '''Print node to the output FILE '''
  3414.         libxml2mod.xmlShellPrintNode(self._o)
  3415.  
  3416.     
  3417.     def addChild(self, cur):
  3418.         '''Add a new node to @parent, at the end of the child (or
  3419.           property) list merging adjacent TEXT nodes (in which case
  3420.           @cur is freed) If the new node is ATTRIBUTE, it is added
  3421.           into properties instead of children. If there is an
  3422.            attribute with equal name, it is first destroyed. '''
  3423.         if cur is None:
  3424.             cur__o = None
  3425.         else:
  3426.             cur__o = cur._o
  3427.         ret = libxml2mod.xmlAddChild(self._o, cur__o)
  3428.         if ret is None:
  3429.             raise treeError('xmlAddChild() failed')
  3430.         ret is None
  3431.         _xmlNode__tmp = xmlNode(_obj = ret)
  3432.         return _xmlNode__tmp
  3433.  
  3434.     
  3435.     def addChildList(self, cur):
  3436.         '''Add a list of node at the end of the child list of the
  3437.            parent merging adjacent TEXT nodes (@cur may be freed) '''
  3438.         if cur is None:
  3439.             cur__o = None
  3440.         else:
  3441.             cur__o = cur._o
  3442.         ret = libxml2mod.xmlAddChildList(self._o, cur__o)
  3443.         if ret is None:
  3444.             raise treeError('xmlAddChildList() failed')
  3445.         ret is None
  3446.         _xmlNode__tmp = xmlNode(_obj = ret)
  3447.         return _xmlNode__tmp
  3448.  
  3449.     
  3450.     def addContent(self, content):
  3451.         '''Append the extra substring to the node content. NOTE: In
  3452.           contrast to xmlNodeSetContent(), @content is supposed to be
  3453.           raw text, so unescaped XML special chars are allowed,
  3454.            entity references are not supported. '''
  3455.         libxml2mod.xmlNodeAddContent(self._o, content)
  3456.  
  3457.     
  3458.     def addContentLen(self, content, len):
  3459.         '''Append the extra substring to the node content. NOTE: In
  3460.           contrast to xmlNodeSetContentLen(), @content is supposed to
  3461.           be raw text, so unescaped XML special chars are allowed,
  3462.            entity references are not supported. '''
  3463.         libxml2mod.xmlNodeAddContentLen(self._o, content, len)
  3464.  
  3465.     
  3466.     def addNextSibling(self, elem):
  3467.         '''Add a new node @elem as the next sibling of @cur If the new
  3468.           node was already inserted in a document it is first
  3469.           unlinked from its existing context. As a result of text
  3470.           merging @elem may be freed. If the new node is ATTRIBUTE,
  3471.           it is added into properties instead of children. If there
  3472.            is an attribute with equal name, it is first destroyed. '''
  3473.         if elem is None:
  3474.             elem__o = None
  3475.         else:
  3476.             elem__o = elem._o
  3477.         ret = libxml2mod.xmlAddNextSibling(self._o, elem__o)
  3478.         if ret is None:
  3479.             raise treeError('xmlAddNextSibling() failed')
  3480.         ret is None
  3481.         _xmlNode__tmp = xmlNode(_obj = ret)
  3482.         return _xmlNode__tmp
  3483.  
  3484.     
  3485.     def addPrevSibling(self, elem):
  3486.         '''Add a new node @elem as the previous sibling of @cur
  3487.           merging adjacent TEXT nodes (@elem may be freed) If the new
  3488.           node was already inserted in a document it is first
  3489.           unlinked from its existing context. If the new node is
  3490.           ATTRIBUTE, it is added into properties instead of children.
  3491.           If there is an attribute with equal name, it is first
  3492.            destroyed. '''
  3493.         if elem is None:
  3494.             elem__o = None
  3495.         else:
  3496.             elem__o = elem._o
  3497.         ret = libxml2mod.xmlAddPrevSibling(self._o, elem__o)
  3498.         if ret is None:
  3499.             raise treeError('xmlAddPrevSibling() failed')
  3500.         ret is None
  3501.         _xmlNode__tmp = xmlNode(_obj = ret)
  3502.         return _xmlNode__tmp
  3503.  
  3504.     
  3505.     def addSibling(self, elem):
  3506.         '''Add a new element @elem to the list of siblings of @cur
  3507.           merging adjacent TEXT nodes (@elem may be freed) If the new
  3508.           element was already inserted in a document it is first
  3509.            unlinked from its existing context. '''
  3510.         if elem is None:
  3511.             elem__o = None
  3512.         else:
  3513.             elem__o = elem._o
  3514.         ret = libxml2mod.xmlAddSibling(self._o, elem__o)
  3515.         if ret is None:
  3516.             raise treeError('xmlAddSibling() failed')
  3517.         ret is None
  3518.         _xmlNode__tmp = xmlNode(_obj = ret)
  3519.         return _xmlNode__tmp
  3520.  
  3521.     
  3522.     def copyNode(self, extended):
  3523.         '''Do a copy of the node. '''
  3524.         ret = libxml2mod.xmlCopyNode(self._o, extended)
  3525.         if ret is None:
  3526.             raise treeError('xmlCopyNode() failed')
  3527.         ret is None
  3528.         _xmlNode__tmp = xmlNode(_obj = ret)
  3529.         return _xmlNode__tmp
  3530.  
  3531.     
  3532.     def copyNodeList(self):
  3533.         '''Do a recursive copy of the node list. Use
  3534.           xmlDocCopyNodeList() if possible to ensure string interning. '''
  3535.         ret = libxml2mod.xmlCopyNodeList(self._o)
  3536.         if ret is None:
  3537.             raise treeError('xmlCopyNodeList() failed')
  3538.         ret is None
  3539.         _xmlNode__tmp = xmlNode(_obj = ret)
  3540.         return _xmlNode__tmp
  3541.  
  3542.     
  3543.     def copyProp(self, cur):
  3544.         '''Do a copy of the attribute. '''
  3545.         if cur is None:
  3546.             cur__o = None
  3547.         else:
  3548.             cur__o = cur._o
  3549.         ret = libxml2mod.xmlCopyProp(self._o, cur__o)
  3550.         if ret is None:
  3551.             raise treeError('xmlCopyProp() failed')
  3552.         ret is None
  3553.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3554.         return _xmlNode__tmp
  3555.  
  3556.     
  3557.     def copyPropList(self, cur):
  3558.         '''Do a copy of an attribute list. '''
  3559.         if cur is None:
  3560.             cur__o = None
  3561.         else:
  3562.             cur__o = cur._o
  3563.         ret = libxml2mod.xmlCopyPropList(self._o, cur__o)
  3564.         if ret is None:
  3565.             raise treeError('xmlCopyPropList() failed')
  3566.         ret is None
  3567.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3568.         return _xmlNode__tmp
  3569.  
  3570.     
  3571.     def docCopyNode(self, doc, extended):
  3572.         '''Do a copy of the node to a given document. '''
  3573.         if doc is None:
  3574.             doc__o = None
  3575.         else:
  3576.             doc__o = doc._o
  3577.         ret = libxml2mod.xmlDocCopyNode(self._o, doc__o, extended)
  3578.         if ret is None:
  3579.             raise treeError('xmlDocCopyNode() failed')
  3580.         ret is None
  3581.         _xmlNode__tmp = xmlNode(_obj = ret)
  3582.         return _xmlNode__tmp
  3583.  
  3584.     
  3585.     def docCopyNodeList(self, doc):
  3586.         '''Do a recursive copy of the node list. '''
  3587.         if doc is None:
  3588.             doc__o = None
  3589.         else:
  3590.             doc__o = doc._o
  3591.         ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o)
  3592.         if ret is None:
  3593.             raise treeError('xmlDocCopyNodeList() failed')
  3594.         ret is None
  3595.         _xmlNode__tmp = xmlNode(_obj = ret)
  3596.         return _xmlNode__tmp
  3597.  
  3598.     
  3599.     def docSetRootElement(self, doc):
  3600.         '''Set the root element of the document (doc->children is a
  3601.            list containing possibly comments, PIs, etc ...). '''
  3602.         if doc is None:
  3603.             doc__o = None
  3604.         else:
  3605.             doc__o = doc._o
  3606.         ret = libxml2mod.xmlDocSetRootElement(doc__o, self._o)
  3607.         if ret is None:
  3608.             return None
  3609.         _xmlNode__tmp = xmlNode(_obj = ret)
  3610.         return _xmlNode__tmp
  3611.  
  3612.     
  3613.     def freeNode(self):
  3614.         """Free a node, this is a recursive behaviour, all the
  3615.           children are freed too. This doesn't unlink the child from
  3616.            the list, use xmlUnlinkNode() first. """
  3617.         libxml2mod.xmlFreeNode(self._o)
  3618.  
  3619.     
  3620.     def freeNodeList(self):
  3621.         '''Free a node and all its siblings, this is a recursive
  3622.            behaviour, all the children are freed too. '''
  3623.         libxml2mod.xmlFreeNodeList(self._o)
  3624.  
  3625.     
  3626.     def getBase(self, doc):
  3627.         '''Searches for the BASE URL. The code should work on both XML
  3628.           and HTML document even if base mechanisms are completely
  3629.           different. It returns the base as defined in RFC 2396
  3630.           sections 5.1.1. Base URI within Document Content and 5.1.2.
  3631.           Base URI from the Encapsulating Entity However it does not
  3632.           return the document base (5.1.3), use xmlDocumentGetBase()
  3633.            for this '''
  3634.         if doc is None:
  3635.             doc__o = None
  3636.         else:
  3637.             doc__o = doc._o
  3638.         ret = libxml2mod.xmlNodeGetBase(doc__o, self._o)
  3639.         return ret
  3640.  
  3641.     
  3642.     def getContent(self):
  3643.         """Read the value of a node, this can be either the text
  3644.           carried directly by this node if it's a TEXT node or the
  3645.           aggregate string of the values carried by this node child's
  3646.            (TEXT and ENTITY_REF). Entity references are substituted. """
  3647.         ret = libxml2mod.xmlNodeGetContent(self._o)
  3648.         return ret
  3649.  
  3650.     
  3651.     def getLang(self):
  3652.         '''Searches the language of a node, i.e. the values of the
  3653.           xml:lang attribute or the one carried by the nearest
  3654.            ancestor. '''
  3655.         ret = libxml2mod.xmlNodeGetLang(self._o)
  3656.         return ret
  3657.  
  3658.     
  3659.     def getSpacePreserve(self):
  3660.         '''Searches the space preserving behaviour of a node, i.e. the
  3661.           values of the xml:space attribute or the one carried by the
  3662.            nearest ancestor. '''
  3663.         ret = libxml2mod.xmlNodeGetSpacePreserve(self._o)
  3664.         return ret
  3665.  
  3666.     
  3667.     def hasNsProp(self, name, nameSpace):
  3668.         '''Search for an attribute associated to a node This attribute
  3669.           has to be anchored in the namespace specified. This does
  3670.           the entity substitution. This function looks in DTD
  3671.           attribute declaration for #FIXED or default declaration
  3672.           values unless DTD use has been turned off. Note that a
  3673.            namespace of None indicates to use the default namespace. '''
  3674.         ret = libxml2mod.xmlHasNsProp(self._o, name, nameSpace)
  3675.         if ret is None:
  3676.             return None
  3677.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3678.         return _xmlNode__tmp
  3679.  
  3680.     
  3681.     def hasProp(self, name):
  3682.         '''Search an attribute associated to a node This function also
  3683.           looks in DTD attribute declaration for #FIXED or default
  3684.            declaration values unless DTD use has been turned off. '''
  3685.         ret = libxml2mod.xmlHasProp(self._o, name)
  3686.         if ret is None:
  3687.             return None
  3688.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3689.         return _xmlNode__tmp
  3690.  
  3691.     
  3692.     def isBlankNode(self):
  3693.         '''Checks whether this node is an empty or whitespace only
  3694.            (and possibly ignorable) text-node. '''
  3695.         ret = libxml2mod.xmlIsBlankNode(self._o)
  3696.         return ret
  3697.  
  3698.     
  3699.     def isText(self):
  3700.         '''Is this node a Text node ? '''
  3701.         ret = libxml2mod.xmlNodeIsText(self._o)
  3702.         return ret
  3703.  
  3704.     
  3705.     def lastChild(self):
  3706.         '''Search the last child of a node. '''
  3707.         ret = libxml2mod.xmlGetLastChild(self._o)
  3708.         if ret is None:
  3709.             raise treeError('xmlGetLastChild() failed')
  3710.         ret is None
  3711.         _xmlNode__tmp = xmlNode(_obj = ret)
  3712.         return _xmlNode__tmp
  3713.  
  3714.     
  3715.     def lineNo(self):
  3716.         '''Get line number of @node. This requires activation of this
  3717.           option before invoking the parser by calling
  3718.            xmlLineNumbersDefault(1) '''
  3719.         ret = libxml2mod.xmlGetLineNo(self._o)
  3720.         return ret
  3721.  
  3722.     
  3723.     def listGetRawString(self, doc, inLine):
  3724.         """Builds the string equivalent to the text contained in the
  3725.           Node list made of TEXTs and ENTITY_REFs, contrary to
  3726.           xmlNodeListGetString() this function doesn't do any
  3727.            character encoding handling. """
  3728.         if doc is None:
  3729.             doc__o = None
  3730.         else:
  3731.             doc__o = doc._o
  3732.         ret = libxml2mod.xmlNodeListGetRawString(doc__o, self._o, inLine)
  3733.         return ret
  3734.  
  3735.     
  3736.     def listGetString(self, doc, inLine):
  3737.         '''Build the string equivalent to the text contained in the
  3738.            Node list made of TEXTs and ENTITY_REFs '''
  3739.         if doc is None:
  3740.             doc__o = None
  3741.         else:
  3742.             doc__o = doc._o
  3743.         ret = libxml2mod.xmlNodeListGetString(doc__o, self._o, inLine)
  3744.         return ret
  3745.  
  3746.     
  3747.     def newChild(self, ns, name, content):
  3748.         '''Creation of a new child element, added at the end of
  3749.           @parent children list. @ns and @content parameters are
  3750.           optional (None). If @ns is None, the newly created element
  3751.           inherits the namespace of @parent. If @content is non None,
  3752.           a child list containing the TEXTs and ENTITY_REFs node will
  3753.           be created. NOTE: @content is supposed to be a piece of XML
  3754.           CDATA, so it allows entity references. XML special chars
  3755.           must be escaped first by using
  3756.           xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
  3757.            be used. '''
  3758.         if ns is None:
  3759.             ns__o = None
  3760.         else:
  3761.             ns__o = ns._o
  3762.         ret = libxml2mod.xmlNewChild(self._o, ns__o, name, content)
  3763.         if ret is None:
  3764.             raise treeError('xmlNewChild() failed')
  3765.         ret is None
  3766.         _xmlNode__tmp = xmlNode(_obj = ret)
  3767.         return _xmlNode__tmp
  3768.  
  3769.     
  3770.     def newNs(self, href, prefix):
  3771.         '''Creation of a new Namespace. This function will refuse to
  3772.           create a namespace with a similar prefix than an existing
  3773.           one present on this node. We use href==None in the case of
  3774.            an element creation where the namespace was not defined. '''
  3775.         ret = libxml2mod.xmlNewNs(self._o, href, prefix)
  3776.         if ret is None:
  3777.             raise treeError('xmlNewNs() failed')
  3778.         ret is None
  3779.         _xmlNode__tmp = xmlNs(_obj = ret)
  3780.         return _xmlNode__tmp
  3781.  
  3782.     
  3783.     def newNsProp(self, ns, name, value):
  3784.         '''Create a new property tagged with a namespace and carried
  3785.            by a node. '''
  3786.         if ns is None:
  3787.             ns__o = None
  3788.         else:
  3789.             ns__o = ns._o
  3790.         ret = libxml2mod.xmlNewNsProp(self._o, ns__o, name, value)
  3791.         if ret is None:
  3792.             raise treeError('xmlNewNsProp() failed')
  3793.         ret is None
  3794.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3795.         return _xmlNode__tmp
  3796.  
  3797.     
  3798.     def newNsPropEatName(self, ns, name, value):
  3799.         '''Create a new property tagged with a namespace and carried
  3800.            by a node. '''
  3801.         if ns is None:
  3802.             ns__o = None
  3803.         else:
  3804.             ns__o = ns._o
  3805.         ret = libxml2mod.xmlNewNsPropEatName(self._o, ns__o, name, value)
  3806.         if ret is None:
  3807.             raise treeError('xmlNewNsPropEatName() failed')
  3808.         ret is None
  3809.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3810.         return _xmlNode__tmp
  3811.  
  3812.     
  3813.     def newProp(self, name, value):
  3814.         '''Create a new property carried by a node. '''
  3815.         ret = libxml2mod.xmlNewProp(self._o, name, value)
  3816.         if ret is None:
  3817.             raise treeError('xmlNewProp() failed')
  3818.         ret is None
  3819.         _xmlNode__tmp = xmlAttr(_obj = ret)
  3820.         return _xmlNode__tmp
  3821.  
  3822.     
  3823.     def newTextChild(self, ns, name, content):
  3824.         '''Creation of a new child element, added at the end of
  3825.           @parent children list. @ns and @content parameters are
  3826.           optional (None). If @ns is None, the newly created element
  3827.           inherits the namespace of @parent. If @content is non None,
  3828.           a child TEXT node will be created containing the string
  3829.           @content. NOTE: Use xmlNewChild() if @content will contain
  3830.           entities that need to be preserved. Use this function,
  3831.           xmlNewTextChild(), if you need to ensure that reserved XML
  3832.           chars that might appear in @content, such as the ampersand,
  3833.           greater-than or less-than signs, are automatically replaced
  3834.            by their XML escaped entity representations. '''
  3835.         if ns is None:
  3836.             ns__o = None
  3837.         else:
  3838.             ns__o = ns._o
  3839.         ret = libxml2mod.xmlNewTextChild(self._o, ns__o, name, content)
  3840.         if ret is None:
  3841.             raise treeError('xmlNewTextChild() failed')
  3842.         ret is None
  3843.         _xmlNode__tmp = xmlNode(_obj = ret)
  3844.         return _xmlNode__tmp
  3845.  
  3846.     
  3847.     def noNsProp(self, name):
  3848.         '''Search and get the value of an attribute associated to a
  3849.           node This does the entity substitution. This function looks
  3850.           in DTD attribute declaration for #FIXED or default
  3851.           declaration values unless DTD use has been turned off. This
  3852.           function is similar to xmlGetProp except it will accept
  3853.            only an attribute in no namespace. '''
  3854.         ret = libxml2mod.xmlGetNoNsProp(self._o, name)
  3855.         return ret
  3856.  
  3857.     
  3858.     def nodePath(self):
  3859.         '''Build a structure based Path for the given node '''
  3860.         ret = libxml2mod.xmlGetNodePath(self._o)
  3861.         return ret
  3862.  
  3863.     
  3864.     def nsProp(self, name, nameSpace):
  3865.         '''Search and get the value of an attribute associated to a
  3866.           node This attribute has to be anchored in the namespace
  3867.           specified. This does the entity substitution. This function
  3868.           looks in DTD attribute declaration for #FIXED or default
  3869.            declaration values unless DTD use has been turned off. '''
  3870.         ret = libxml2mod.xmlGetNsProp(self._o, name, nameSpace)
  3871.         return ret
  3872.  
  3873.     
  3874.     def prop(self, name):
  3875.         '''Search and get the value of an attribute associated to a
  3876.           node This does the entity substitution. This function looks
  3877.           in DTD attribute declaration for #FIXED or default
  3878.           declaration values unless DTD use has been turned off.
  3879.           NOTE: this function acts independently of namespaces
  3880.           associated to the attribute. Use xmlGetNsProp() or
  3881.            xmlGetNoNsProp() for namespace aware processing. '''
  3882.         ret = libxml2mod.xmlGetProp(self._o, name)
  3883.         return ret
  3884.  
  3885.     
  3886.     def reconciliateNs(self, doc):
  3887.         '''This function checks that all the namespaces declared
  3888.           within the given tree are properly declared. This is needed
  3889.           for example after Copy or Cut and then paste operations.
  3890.           The subtree may still hold pointers to namespace
  3891.           declarations outside the subtree or invalid/masked. As much
  3892.           as possible the function try to reuse the existing
  3893.           namespaces found in the new environment. If not possible
  3894.           the new namespaces are redeclared on @tree at the top of
  3895.            the given subtree. '''
  3896.         if doc is None:
  3897.             doc__o = None
  3898.         else:
  3899.             doc__o = doc._o
  3900.         ret = libxml2mod.xmlReconciliateNs(doc__o, self._o)
  3901.         return ret
  3902.  
  3903.     
  3904.     def replaceNode(self, cur):
  3905.         '''Unlink the old node from its current context, prune the new
  3906.           one at the same place. If @cur was already inserted in a
  3907.            document it is first unlinked from its existing context. '''
  3908.         if cur is None:
  3909.             cur__o = None
  3910.         else:
  3911.             cur__o = cur._o
  3912.         ret = libxml2mod.xmlReplaceNode(self._o, cur__o)
  3913.         if ret is None:
  3914.             raise treeError('xmlReplaceNode() failed')
  3915.         ret is None
  3916.         _xmlNode__tmp = xmlNode(_obj = ret)
  3917.         return _xmlNode__tmp
  3918.  
  3919.     
  3920.     def searchNs(self, doc, nameSpace):
  3921.         """Search a Ns registered under a given name space for a
  3922.           document. recurse on the parents until it finds the defined
  3923.           namespace or return None otherwise. @nameSpace can be None,
  3924.           this is a search for the default namespace. We don't allow
  3925.           to cross entities boundaries. If you don't declare the
  3926.           namespace within those you will be in troubles !!! A
  3927.            warning is generated to cover this case. """
  3928.         if doc is None:
  3929.             doc__o = None
  3930.         else:
  3931.             doc__o = doc._o
  3932.         ret = libxml2mod.xmlSearchNs(doc__o, self._o, nameSpace)
  3933.         if ret is None:
  3934.             raise treeError('xmlSearchNs() failed')
  3935.         ret is None
  3936.         _xmlNode__tmp = xmlNs(_obj = ret)
  3937.         return _xmlNode__tmp
  3938.  
  3939.     
  3940.     def searchNsByHref(self, doc, href):
  3941.         '''Search a Ns aliasing a given URI. Recurse on the parents
  3942.           until it finds the defined namespace or return None
  3943.            otherwise. '''
  3944.         if doc is None:
  3945.             doc__o = None
  3946.         else:
  3947.             doc__o = doc._o
  3948.         ret = libxml2mod.xmlSearchNsByHref(doc__o, self._o, href)
  3949.         if ret is None:
  3950.             raise treeError('xmlSearchNsByHref() failed')
  3951.         ret is None
  3952.         _xmlNode__tmp = xmlNs(_obj = ret)
  3953.         return _xmlNode__tmp
  3954.  
  3955.     
  3956.     def setBase(self, uri):
  3957.         '''Set (or reset) the base URI of a node, i.e. the value of
  3958.            the xml:base attribute. '''
  3959.         libxml2mod.xmlNodeSetBase(self._o, uri)
  3960.  
  3961.     
  3962.     def setContent(self, content):
  3963.         '''Replace the content of a node. NOTE: @content is supposed
  3964.           to be a piece of XML CDATA, so it allows entity references,
  3965.           but XML special chars need to be escaped first by using
  3966.            xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). '''
  3967.         libxml2mod.xmlNodeSetContent(self._o, content)
  3968.  
  3969.     
  3970.     def setContentLen(self, content, len):
  3971.         '''Replace the content of a node. NOTE: @content is supposed
  3972.           to be a piece of XML CDATA, so it allows entity references,
  3973.           but XML special chars need to be escaped first by using
  3974.            xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). '''
  3975.         libxml2mod.xmlNodeSetContentLen(self._o, content, len)
  3976.  
  3977.     
  3978.     def setLang(self, lang):
  3979.         '''Set the language of a node, i.e. the values of the xml:lang
  3980.            attribute. '''
  3981.         libxml2mod.xmlNodeSetLang(self._o, lang)
  3982.  
  3983.     
  3984.     def setListDoc(self, doc):
  3985.         '''update all nodes in the list to point to the right document '''
  3986.         if doc is None:
  3987.             doc__o = None
  3988.         else:
  3989.             doc__o = doc._o
  3990.         libxml2mod.xmlSetListDoc(self._o, doc__o)
  3991.  
  3992.     
  3993.     def setName(self, name):
  3994.         '''Set (or reset) the name of a node. '''
  3995.         libxml2mod.xmlNodeSetName(self._o, name)
  3996.  
  3997.     
  3998.     def setNs(self, ns):
  3999.         '''Associate a namespace to a node, a posteriori. '''
  4000.         if ns is None:
  4001.             ns__o = None
  4002.         else:
  4003.             ns__o = ns._o
  4004.         libxml2mod.xmlSetNs(self._o, ns__o)
  4005.  
  4006.     
  4007.     def setNsProp(self, ns, name, value):
  4008.         '''Set (or reset) an attribute carried by a node. The ns
  4009.            structure must be in scope, this is not checked '''
  4010.         if ns is None:
  4011.             ns__o = None
  4012.         else:
  4013.             ns__o = ns._o
  4014.         ret = libxml2mod.xmlSetNsProp(self._o, ns__o, name, value)
  4015.         if ret is None:
  4016.             raise treeError('xmlSetNsProp() failed')
  4017.         ret is None
  4018.         _xmlNode__tmp = xmlAttr(_obj = ret)
  4019.         return _xmlNode__tmp
  4020.  
  4021.     
  4022.     def setProp(self, name, value):
  4023.         """Set (or reset) an attribute carried by a node. If @name has
  4024.           a prefix, then the corresponding namespace-binding will be
  4025.           used, if in scope; it is an error it there's no such
  4026.            ns-binding for the prefix in scope. """
  4027.         ret = libxml2mod.xmlSetProp(self._o, name, value)
  4028.         if ret is None:
  4029.             raise treeError('xmlSetProp() failed')
  4030.         ret is None
  4031.         _xmlNode__tmp = xmlAttr(_obj = ret)
  4032.         return _xmlNode__tmp
  4033.  
  4034.     
  4035.     def setSpacePreserve(self, val):
  4036.         '''Set (or reset) the space preserving behaviour of a node,
  4037.            i.e. the value of the xml:space attribute. '''
  4038.         libxml2mod.xmlNodeSetSpacePreserve(self._o, val)
  4039.  
  4040.     
  4041.     def setTreeDoc(self, doc):
  4042.         '''update all nodes under the tree to point to the right
  4043.            document '''
  4044.         if doc is None:
  4045.             doc__o = None
  4046.         else:
  4047.             doc__o = doc._o
  4048.         libxml2mod.xmlSetTreeDoc(self._o, doc__o)
  4049.  
  4050.     
  4051.     def textConcat(self, content, len):
  4052.         '''Concat the given string at the end of the existing node
  4053.            content '''
  4054.         ret = libxml2mod.xmlTextConcat(self._o, content, len)
  4055.         return ret
  4056.  
  4057.     
  4058.     def textMerge(self, second):
  4059.         '''Merge two text nodes into one '''
  4060.         if second is None:
  4061.             second__o = None
  4062.         else:
  4063.             second__o = second._o
  4064.         ret = libxml2mod.xmlTextMerge(self._o, second__o)
  4065.         if ret is None:
  4066.             raise treeError('xmlTextMerge() failed')
  4067.         ret is None
  4068.         _xmlNode__tmp = xmlNode(_obj = ret)
  4069.         return _xmlNode__tmp
  4070.  
  4071.     
  4072.     def unlinkNode(self):
  4073.         """Unlink a node from it's current context, the node is not
  4074.            freed """
  4075.         libxml2mod.xmlUnlinkNode(self._o)
  4076.  
  4077.     
  4078.     def unsetNsProp(self, ns, name):
  4079.         '''Remove an attribute carried by a node. '''
  4080.         if ns is None:
  4081.             ns__o = None
  4082.         else:
  4083.             ns__o = ns._o
  4084.         ret = libxml2mod.xmlUnsetNsProp(self._o, ns__o, name)
  4085.         return ret
  4086.  
  4087.     
  4088.     def unsetProp(self, name):
  4089.         '''Remove an attribute carried by a node. This handles only
  4090.            attributes in no namespace. '''
  4091.         ret = libxml2mod.xmlUnsetProp(self._o, name)
  4092.         return ret
  4093.  
  4094.     
  4095.     def isID(self, doc, attr):
  4096.         '''Determine whether an attribute is of type ID. In case we
  4097.           have DTD(s) then this is done if DTD loading has been
  4098.           requested. In the case of HTML documents parsed with the
  4099.            HTML parser, then ID detection is done systematically. '''
  4100.         if doc is None:
  4101.             doc__o = None
  4102.         else:
  4103.             doc__o = doc._o
  4104.         if attr is None:
  4105.             attr__o = None
  4106.         else:
  4107.             attr__o = attr._o
  4108.         ret = libxml2mod.xmlIsID(doc__o, self._o, attr__o)
  4109.         return ret
  4110.  
  4111.     
  4112.     def isRef(self, doc, attr):
  4113.         '''Determine whether an attribute is of type Ref. In case we
  4114.           have DTD(s) then this is simple, otherwise we use an
  4115.            heuristic: name Ref (upper or lowercase). '''
  4116.         if doc is None:
  4117.             doc__o = None
  4118.         else:
  4119.             doc__o = doc._o
  4120.         if attr is None:
  4121.             attr__o = None
  4122.         else:
  4123.             attr__o = attr._o
  4124.         ret = libxml2mod.xmlIsRef(doc__o, self._o, attr__o)
  4125.         return ret
  4126.  
  4127.     
  4128.     def validNormalizeAttributeValue(self, doc, name, value):
  4129.         '''Does the validation related extra step of the normalization
  4130.           of attribute values:  If the declared value is not CDATA,
  4131.           then the XML processor must further process the normalized
  4132.           attribute value by discarding any leading and trailing
  4133.           space (#x20) characters, and by replacing sequences of
  4134.            space (#x20) characters by single space (#x20) character. '''
  4135.         if doc is None:
  4136.             doc__o = None
  4137.         else:
  4138.             doc__o = doc._o
  4139.         ret = libxml2mod.xmlValidNormalizeAttributeValue(doc__o, self._o, name, value)
  4140.         return ret
  4141.  
  4142.     
  4143.     def xincludeProcessTree(self):
  4144.         '''Implement the XInclude substitution for the given subtree '''
  4145.         ret = libxml2mod.xmlXIncludeProcessTree(self._o)
  4146.         return ret
  4147.  
  4148.     
  4149.     def xincludeProcessTreeFlags(self, flags):
  4150.         '''Implement the XInclude substitution for the given subtree '''
  4151.         ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags)
  4152.         return ret
  4153.  
  4154.     
  4155.     def schemaValidateOneElement(self, ctxt):
  4156.         if ctxt is None:
  4157.             ctxt__o = None
  4158.         else:
  4159.             ctxt__o = ctxt._o
  4160.         ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)
  4161.         return ret
  4162.  
  4163.     
  4164.     def xpathCastNodeToNumber(self):
  4165.         '''Converts a node to its number value '''
  4166.         ret = libxml2mod.xmlXPathCastNodeToNumber(self._o)
  4167.         return ret
  4168.  
  4169.     
  4170.     def xpathCastNodeToString(self):
  4171.         '''Converts a node to its string value. '''
  4172.         ret = libxml2mod.xmlXPathCastNodeToString(self._o)
  4173.         return ret
  4174.  
  4175.     
  4176.     def xpathCmpNodes(self, node2):
  4177.         '''Compare two nodes w.r.t document order '''
  4178.         if node2 is None:
  4179.             node2__o = None
  4180.         else:
  4181.             node2__o = node2._o
  4182.         ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o)
  4183.         return ret
  4184.  
  4185.     
  4186.     def xpathNewNodeSet(self):
  4187.         '''Create a new xmlXPathObjectPtr of type NodeSet and
  4188.            initialize it with the single Node @val '''
  4189.         ret = libxml2mod.xmlXPathNewNodeSet(self._o)
  4190.         if ret is None:
  4191.             raise xpathError('xmlXPathNewNodeSet() failed')
  4192.         ret is None
  4193.         return xpathObjectRet(ret)
  4194.  
  4195.     
  4196.     def xpathNewValueTree(self):
  4197.         '''Create a new xmlXPathObjectPtr of type Value Tree (XSLT)
  4198.            and initialize it with the tree root @val '''
  4199.         ret = libxml2mod.xmlXPathNewValueTree(self._o)
  4200.         if ret is None:
  4201.             raise xpathError('xmlXPathNewValueTree() failed')
  4202.         ret is None
  4203.         return xpathObjectRet(ret)
  4204.  
  4205.     
  4206.     def xpathNextAncestor(self, ctxt):
  4207.         '''Traversal function for the "ancestor" direction the
  4208.           ancestor axis contains the ancestors of the context node;
  4209.           the ancestors of the context node consist of the parent of
  4210.           context node and the parent\'s parent and so on; the nodes
  4211.           are ordered in reverse document order; thus the parent is
  4212.           the first node on the axis, and the parent\'s parent is the
  4213.            second node on the axis '''
  4214.         if ctxt is None:
  4215.             ctxt__o = None
  4216.         else:
  4217.             ctxt__o = ctxt._o
  4218.         ret = libxml2mod.xmlXPathNextAncestor(ctxt__o, self._o)
  4219.         if ret is None:
  4220.             raise xpathError('xmlXPathNextAncestor() failed')
  4221.         ret is None
  4222.         _xmlNode__tmp = xmlNode(_obj = ret)
  4223.         return _xmlNode__tmp
  4224.  
  4225.     
  4226.     def xpathNextAncestorOrSelf(self, ctxt):
  4227.         '''Traversal function for the "ancestor-or-self" direction he
  4228.           ancestor-or-self axis contains the context node and
  4229.           ancestors of the context node in reverse document order;
  4230.           thus the context node is the first node on the axis, and
  4231.           the context node\'s parent the second; parent here is
  4232.            defined the same as with the parent axis. '''
  4233.         if ctxt is None:
  4234.             ctxt__o = None
  4235.         else:
  4236.             ctxt__o = ctxt._o
  4237.         ret = libxml2mod.xmlXPathNextAncestorOrSelf(ctxt__o, self._o)
  4238.         if ret is None:
  4239.             raise xpathError('xmlXPathNextAncestorOrSelf() failed')
  4240.         ret is None
  4241.         _xmlNode__tmp = xmlNode(_obj = ret)
  4242.         return _xmlNode__tmp
  4243.  
  4244.     
  4245.     def xpathNextAttribute(self, ctxt):
  4246.         '''Traversal function for the "attribute" direction TODO:
  4247.            support DTD inherited default attributes '''
  4248.         if ctxt is None:
  4249.             ctxt__o = None
  4250.         else:
  4251.             ctxt__o = ctxt._o
  4252.         ret = libxml2mod.xmlXPathNextAttribute(ctxt__o, self._o)
  4253.         if ret is None:
  4254.             raise xpathError('xmlXPathNextAttribute() failed')
  4255.         ret is None
  4256.         _xmlNode__tmp = xmlNode(_obj = ret)
  4257.         return _xmlNode__tmp
  4258.  
  4259.     
  4260.     def xpathNextChild(self, ctxt):
  4261.         '''Traversal function for the "child" direction The child axis
  4262.           contains the children of the context node in document order. '''
  4263.         if ctxt is None:
  4264.             ctxt__o = None
  4265.         else:
  4266.             ctxt__o = ctxt._o
  4267.         ret = libxml2mod.xmlXPathNextChild(ctxt__o, self._o)
  4268.         if ret is None:
  4269.             raise xpathError('xmlXPathNextChild() failed')
  4270.         ret is None
  4271.         _xmlNode__tmp = xmlNode(_obj = ret)
  4272.         return _xmlNode__tmp
  4273.  
  4274.     
  4275.     def xpathNextDescendant(self, ctxt):
  4276.         '''Traversal function for the "descendant" direction the
  4277.           descendant axis contains the descendants of the context
  4278.           node in document order; a descendant is a child or a child
  4279.            of a child and so on. '''
  4280.         if ctxt is None:
  4281.             ctxt__o = None
  4282.         else:
  4283.             ctxt__o = ctxt._o
  4284.         ret = libxml2mod.xmlXPathNextDescendant(ctxt__o, self._o)
  4285.         if ret is None:
  4286.             raise xpathError('xmlXPathNextDescendant() failed')
  4287.         ret is None
  4288.         _xmlNode__tmp = xmlNode(_obj = ret)
  4289.         return _xmlNode__tmp
  4290.  
  4291.     
  4292.     def xpathNextDescendantOrSelf(self, ctxt):
  4293.         '''Traversal function for the "descendant-or-self" direction
  4294.           the descendant-or-self axis contains the context node and
  4295.           the descendants of the context node in document order; thus
  4296.           the context node is the first node on the axis, and the
  4297.           first child of the context node is the second node on the
  4298.            axis '''
  4299.         if ctxt is None:
  4300.             ctxt__o = None
  4301.         else:
  4302.             ctxt__o = ctxt._o
  4303.         ret = libxml2mod.xmlXPathNextDescendantOrSelf(ctxt__o, self._o)
  4304.         if ret is None:
  4305.             raise xpathError('xmlXPathNextDescendantOrSelf() failed')
  4306.         ret is None
  4307.         _xmlNode__tmp = xmlNode(_obj = ret)
  4308.         return _xmlNode__tmp
  4309.  
  4310.     
  4311.     def xpathNextFollowing(self, ctxt):
  4312.         '''Traversal function for the "following" direction The
  4313.           following axis contains all nodes in the same document as
  4314.           the context node that are after the context node in
  4315.           document order, excluding any descendants and excluding
  4316.           attribute nodes and namespace nodes; the nodes are ordered
  4317.            in document order '''
  4318.         if ctxt is None:
  4319.             ctxt__o = None
  4320.         else:
  4321.             ctxt__o = ctxt._o
  4322.         ret = libxml2mod.xmlXPathNextFollowing(ctxt__o, self._o)
  4323.         if ret is None:
  4324.             raise xpathError('xmlXPathNextFollowing() failed')
  4325.         ret is None
  4326.         _xmlNode__tmp = xmlNode(_obj = ret)
  4327.         return _xmlNode__tmp
  4328.  
  4329.     
  4330.     def xpathNextFollowingSibling(self, ctxt):
  4331.         '''Traversal function for the "following-sibling" direction
  4332.           The following-sibling axis contains the following siblings
  4333.            of the context node in document order. '''
  4334.         if ctxt is None:
  4335.             ctxt__o = None
  4336.         else:
  4337.             ctxt__o = ctxt._o
  4338.         ret = libxml2mod.xmlXPathNextFollowingSibling(ctxt__o, self._o)
  4339.         if ret is None:
  4340.             raise xpathError('xmlXPathNextFollowingSibling() failed')
  4341.         ret is None
  4342.         _xmlNode__tmp = xmlNode(_obj = ret)
  4343.         return _xmlNode__tmp
  4344.  
  4345.     
  4346.     def xpathNextNamespace(self, ctxt):
  4347.         '''Traversal function for the "namespace" direction the
  4348.           namespace axis contains the namespace nodes of the context
  4349.           node; the order of nodes on this axis is
  4350.           implementation-defined; the axis will be empty unless the
  4351.           context node is an element  We keep the XML namespace node
  4352.            at the end of the list. '''
  4353.         if ctxt is None:
  4354.             ctxt__o = None
  4355.         else:
  4356.             ctxt__o = ctxt._o
  4357.         ret = libxml2mod.xmlXPathNextNamespace(ctxt__o, self._o)
  4358.         if ret is None:
  4359.             raise xpathError('xmlXPathNextNamespace() failed')
  4360.         ret is None
  4361.         _xmlNode__tmp = xmlNode(_obj = ret)
  4362.         return _xmlNode__tmp
  4363.  
  4364.     
  4365.     def xpathNextParent(self, ctxt):
  4366.         '''Traversal function for the "parent" direction The parent
  4367.           axis contains the parent of the context node, if there is
  4368.            one. '''
  4369.         if ctxt is None:
  4370.             ctxt__o = None
  4371.         else:
  4372.             ctxt__o = ctxt._o
  4373.         ret = libxml2mod.xmlXPathNextParent(ctxt__o, self._o)
  4374.         if ret is None:
  4375.             raise xpathError('xmlXPathNextParent() failed')
  4376.         ret is None
  4377.         _xmlNode__tmp = xmlNode(_obj = ret)
  4378.         return _xmlNode__tmp
  4379.  
  4380.     
  4381.     def xpathNextPreceding(self, ctxt):
  4382.         '''Traversal function for the "preceding" direction the
  4383.           preceding axis contains all nodes in the same document as
  4384.           the context node that are before the context node in
  4385.           document order, excluding any ancestors and excluding
  4386.           attribute nodes and namespace nodes; the nodes are ordered
  4387.            in reverse document order '''
  4388.         if ctxt is None:
  4389.             ctxt__o = None
  4390.         else:
  4391.             ctxt__o = ctxt._o
  4392.         ret = libxml2mod.xmlXPathNextPreceding(ctxt__o, self._o)
  4393.         if ret is None:
  4394.             raise xpathError('xmlXPathNextPreceding() failed')
  4395.         ret is None
  4396.         _xmlNode__tmp = xmlNode(_obj = ret)
  4397.         return _xmlNode__tmp
  4398.  
  4399.     
  4400.     def xpathNextPrecedingSibling(self, ctxt):
  4401.         '''Traversal function for the "preceding-sibling" direction
  4402.           The preceding-sibling axis contains the preceding siblings
  4403.           of the context node in reverse document order; the first
  4404.           preceding sibling is first on the axis; the sibling
  4405.            preceding that node is the second on the axis and so on. '''
  4406.         if ctxt is None:
  4407.             ctxt__o = None
  4408.         else:
  4409.             ctxt__o = ctxt._o
  4410.         ret = libxml2mod.xmlXPathNextPrecedingSibling(ctxt__o, self._o)
  4411.         if ret is None:
  4412.             raise xpathError('xmlXPathNextPrecedingSibling() failed')
  4413.         ret is None
  4414.         _xmlNode__tmp = xmlNode(_obj = ret)
  4415.         return _xmlNode__tmp
  4416.  
  4417.     
  4418.     def xpathNextSelf(self, ctxt):
  4419.         '''Traversal function for the "self" direction The self axis
  4420.            contains just the context node itself '''
  4421.         if ctxt is None:
  4422.             ctxt__o = None
  4423.         else:
  4424.             ctxt__o = ctxt._o
  4425.         ret = libxml2mod.xmlXPathNextSelf(ctxt__o, self._o)
  4426.         if ret is None:
  4427.             raise xpathError('xmlXPathNextSelf() failed')
  4428.         ret is None
  4429.         _xmlNode__tmp = xmlNode(_obj = ret)
  4430.         return _xmlNode__tmp
  4431.  
  4432.     
  4433.     def xpointerNewCollapsedRange(self):
  4434.         '''Create a new xmlXPathObjectPtr of type range using a single
  4435.            nodes '''
  4436.         ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o)
  4437.         if ret is None:
  4438.             raise treeError('xmlXPtrNewCollapsedRange() failed')
  4439.         ret is None
  4440.         return xpathObjectRet(ret)
  4441.  
  4442.     
  4443.     def xpointerNewContext(self, doc, origin):
  4444.         '''Create a new XPointer context '''
  4445.         if doc is None:
  4446.             doc__o = None
  4447.         else:
  4448.             doc__o = doc._o
  4449.         if origin is None:
  4450.             origin__o = None
  4451.         else:
  4452.             origin__o = origin._o
  4453.         ret = libxml2mod.xmlXPtrNewContext(doc__o, self._o, origin__o)
  4454.         if ret is None:
  4455.             raise treeError('xmlXPtrNewContext() failed')
  4456.         ret is None
  4457.         _xmlNode__tmp = xpathContext(_obj = ret)
  4458.         return _xmlNode__tmp
  4459.  
  4460.     
  4461.     def xpointerNewLocationSetNodes(self, end):
  4462.         '''Create a new xmlXPathObjectPtr of type LocationSet and
  4463.           initialize it with the single range made of the two nodes
  4464.            @start and @end '''
  4465.         if end is None:
  4466.             end__o = None
  4467.         else:
  4468.             end__o = end._o
  4469.         ret = libxml2mod.xmlXPtrNewLocationSetNodes(self._o, end__o)
  4470.         if ret is None:
  4471.             raise treeError('xmlXPtrNewLocationSetNodes() failed')
  4472.         ret is None
  4473.         return xpathObjectRet(ret)
  4474.  
  4475.     
  4476.     def xpointerNewRange(self, startindex, end, endindex):
  4477.         '''Create a new xmlXPathObjectPtr of type range '''
  4478.         if end is None:
  4479.             end__o = None
  4480.         else:
  4481.             end__o = end._o
  4482.         ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex)
  4483.         if ret is None:
  4484.             raise treeError('xmlXPtrNewRange() failed')
  4485.         ret is None
  4486.         return xpathObjectRet(ret)
  4487.  
  4488.     
  4489.     def xpointerNewRangeNodes(self, end):
  4490.         '''Create a new xmlXPathObjectPtr of type range using 2 nodes '''
  4491.         if end is None:
  4492.             end__o = None
  4493.         else:
  4494.             end__o = end._o
  4495.         ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
  4496.         if ret is None:
  4497.             raise treeError('xmlXPtrNewRangeNodes() failed')
  4498.         ret is None
  4499.         return xpathObjectRet(ret)
  4500.  
  4501.  
  4502.  
  4503. class xmlDoc(xmlNode):
  4504.     
  4505.     def __init__(self, _obj = None):
  4506.         if type(_obj).__name__ != 'PyCObject':
  4507.             raise TypeError, 'xmlDoc needs a PyCObject argument'
  4508.         type(_obj).__name__ != 'PyCObject'
  4509.         self._o = _obj
  4510.         xmlNode.__init__(self, _obj = _obj)
  4511.  
  4512.     
  4513.     def __repr__(self):
  4514.         return '<xmlDoc (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  4515.  
  4516.     
  4517.     def htmlAutoCloseTag(self, name, elem):
  4518.         """The HTML DTD allows a tag to implicitly close other tags.
  4519.           The list is kept in htmlStartClose array. This function
  4520.           checks if the element or one of it's children would
  4521.            autoclose the given tag. """
  4522.         ret = libxml2mod.htmlAutoCloseTag(self._o, name, elem)
  4523.         return ret
  4524.  
  4525.     
  4526.     def htmlIsAutoClosed(self, elem):
  4527.         """The HTML DTD allows a tag to implicitly close other tags.
  4528.           The list is kept in htmlStartClose array. This function
  4529.            checks if a tag is autoclosed by one of it's child """
  4530.         ret = libxml2mod.htmlIsAutoClosed(self._o, elem)
  4531.         return ret
  4532.  
  4533.     
  4534.     def htmlDocContentDumpFormatOutput(self, buf, encoding, format):
  4535.         '''Dump an HTML document. '''
  4536.         if buf is None:
  4537.             buf__o = None
  4538.         else:
  4539.             buf__o = buf._o
  4540.         libxml2mod.htmlDocContentDumpFormatOutput(buf__o, self._o, encoding, format)
  4541.  
  4542.     
  4543.     def htmlDocContentDumpOutput(self, buf, encoding):
  4544.         '''Dump an HTML document. Formating return/spaces are added. '''
  4545.         if buf is None:
  4546.             buf__o = None
  4547.         else:
  4548.             buf__o = buf._o
  4549.         libxml2mod.htmlDocContentDumpOutput(buf__o, self._o, encoding)
  4550.  
  4551.     
  4552.     def htmlDocDump(self, f):
  4553.         '''Dump an HTML document to an open FILE. '''
  4554.         ret = libxml2mod.htmlDocDump(f, self._o)
  4555.         return ret
  4556.  
  4557.     
  4558.     def htmlGetMetaEncoding(self):
  4559.         '''Encoding definition lookup in the Meta tags '''
  4560.         ret = libxml2mod.htmlGetMetaEncoding(self._o)
  4561.         return ret
  4562.  
  4563.     
  4564.     def htmlNodeDumpFile(self, out, cur):
  4565.         '''Dump an HTML node, recursive behaviour,children are printed
  4566.            too, and formatting returns are added. '''
  4567.         if cur is None:
  4568.             cur__o = None
  4569.         else:
  4570.             cur__o = cur._o
  4571.         libxml2mod.htmlNodeDumpFile(out, self._o, cur__o)
  4572.  
  4573.     
  4574.     def htmlNodeDumpFileFormat(self, out, cur, encoding, format):
  4575.         '''Dump an HTML node, recursive behaviour,children are printed
  4576.           too.  TODO: if encoding == None try to save in the doc
  4577.            encoding '''
  4578.         if cur is None:
  4579.             cur__o = None
  4580.         else:
  4581.             cur__o = cur._o
  4582.         ret = libxml2mod.htmlNodeDumpFileFormat(out, self._o, cur__o, encoding, format)
  4583.         return ret
  4584.  
  4585.     
  4586.     def htmlNodeDumpFormatOutput(self, buf, cur, encoding, format):
  4587.         '''Dump an HTML node, recursive behaviour,children are printed
  4588.            too. '''
  4589.         if buf is None:
  4590.             buf__o = None
  4591.         else:
  4592.             buf__o = buf._o
  4593.         if cur is None:
  4594.             cur__o = None
  4595.         else:
  4596.             cur__o = cur._o
  4597.         libxml2mod.htmlNodeDumpFormatOutput(buf__o, self._o, cur__o, encoding, format)
  4598.  
  4599.     
  4600.     def htmlNodeDumpOutput(self, buf, cur, encoding):
  4601.         '''Dump an HTML node, recursive behaviour,children are printed
  4602.            too, and formatting returns/spaces are added. '''
  4603.         if buf is None:
  4604.             buf__o = None
  4605.         else:
  4606.             buf__o = buf._o
  4607.         if cur is None:
  4608.             cur__o = None
  4609.         else:
  4610.             cur__o = cur._o
  4611.         libxml2mod.htmlNodeDumpOutput(buf__o, self._o, cur__o, encoding)
  4612.  
  4613.     
  4614.     def htmlSaveFile(self, filename):
  4615.         '''Dump an HTML document to a file. If @filename is "-" the
  4616.            stdout file is used. '''
  4617.         ret = libxml2mod.htmlSaveFile(filename, self._o)
  4618.         return ret
  4619.  
  4620.     
  4621.     def htmlSaveFileEnc(self, filename, encoding):
  4622.         '''Dump an HTML document to a file using a given encoding and
  4623.            formatting returns/spaces are added. '''
  4624.         ret = libxml2mod.htmlSaveFileEnc(filename, self._o, encoding)
  4625.         return ret
  4626.  
  4627.     
  4628.     def htmlSaveFileFormat(self, filename, encoding, format):
  4629.         '''Dump an HTML document to a file using a given encoding. '''
  4630.         ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format)
  4631.         return ret
  4632.  
  4633.     
  4634.     def htmlSetMetaEncoding(self, encoding):
  4635.         '''Sets the current encoding in the Meta tags NOTE: this will
  4636.           not change the document content encoding, just the META
  4637.            flag associated. '''
  4638.         ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
  4639.         return ret
  4640.  
  4641.     
  4642.     def debugCheckDocument(self, output):
  4643.         '''Check the document for potential content problems, and
  4644.            output the errors to @output '''
  4645.         ret = libxml2mod.xmlDebugCheckDocument(output, self._o)
  4646.         return ret
  4647.  
  4648.     
  4649.     def debugDumpDocument(self, output):
  4650.         """Dumps debug information for the document, it's recursive """
  4651.         libxml2mod.xmlDebugDumpDocument(output, self._o)
  4652.  
  4653.     
  4654.     def debugDumpDocumentHead(self, output):
  4655.         '''Dumps debug information cncerning the document, not
  4656.            recursive '''
  4657.         libxml2mod.xmlDebugDumpDocumentHead(output, self._o)
  4658.  
  4659.     
  4660.     def debugDumpEntities(self, output):
  4661.         '''Dumps debug information for all the entities in use by the
  4662.            document '''
  4663.         libxml2mod.xmlDebugDumpEntities(output, self._o)
  4664.  
  4665.     
  4666.     def addDocEntity(self, name, type, ExternalID, SystemID, content):
  4667.         '''Register a new entity for this document. '''
  4668.         ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
  4669.         if ret is None:
  4670.             raise treeError('xmlAddDocEntity() failed')
  4671.         ret is None
  4672.         _xmlDoc__tmp = xmlEntity(_obj = ret)
  4673.         return _xmlDoc__tmp
  4674.  
  4675.     
  4676.     def addDtdEntity(self, name, type, ExternalID, SystemID, content):
  4677.         '''Register a new entity for this document DTD external subset. '''
  4678.         ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)
  4679.         if ret is None:
  4680.             raise treeError('xmlAddDtdEntity() failed')
  4681.         ret is None
  4682.         _xmlDoc__tmp = xmlEntity(_obj = ret)
  4683.         return _xmlDoc__tmp
  4684.  
  4685.     
  4686.     def docEntity(self, name):
  4687.         '''Do an entity lookup in the document entity hash table and '''
  4688.         ret = libxml2mod.xmlGetDocEntity(self._o, name)
  4689.         if ret is None:
  4690.             raise treeError('xmlGetDocEntity() failed')
  4691.         ret is None
  4692.         _xmlDoc__tmp = xmlEntity(_obj = ret)
  4693.         return _xmlDoc__tmp
  4694.  
  4695.     
  4696.     def dtdEntity(self, name):
  4697.         '''Do an entity lookup in the DTD entity hash table and '''
  4698.         ret = libxml2mod.xmlGetDtdEntity(self._o, name)
  4699.         if ret is None:
  4700.             raise treeError('xmlGetDtdEntity() failed')
  4701.         ret is None
  4702.         _xmlDoc__tmp = xmlEntity(_obj = ret)
  4703.         return _xmlDoc__tmp
  4704.  
  4705.     
  4706.     def encodeEntities(self, input):
  4707.         '''TODO: remove xmlEncodeEntities, once we are not afraid of
  4708.           breaking binary compatibility  People must migrate their
  4709.           code to xmlEncodeEntitiesReentrant ! This routine will
  4710.            issue a warning when encountered. '''
  4711.         ret = libxml2mod.xmlEncodeEntities(self._o, input)
  4712.         return ret
  4713.  
  4714.     
  4715.     def encodeEntitiesReentrant(self, input):
  4716.         '''Do a global encoding of a string, replacing the predefined
  4717.           entities and non ASCII values with their entities and
  4718.           CharRef counterparts. Contrary to xmlEncodeEntities, this
  4719.            routine is reentrant, and result must be deallocated. '''
  4720.         ret = libxml2mod.xmlEncodeEntitiesReentrant(self._o, input)
  4721.         return ret
  4722.  
  4723.     
  4724.     def encodeSpecialChars(self, input):
  4725.         '''Do a global encoding of a string, replacing the predefined
  4726.           entities this routine is reentrant, and result must be
  4727.            deallocated. '''
  4728.         ret = libxml2mod.xmlEncodeSpecialChars(self._o, input)
  4729.         return ret
  4730.  
  4731.     
  4732.     def parameterEntity(self, name):
  4733.         '''Do an entity lookup in the internal and external subsets and '''
  4734.         ret = libxml2mod.xmlGetParameterEntity(self._o, name)
  4735.         if ret is None:
  4736.             raise treeError('xmlGetParameterEntity() failed')
  4737.         ret is None
  4738.         _xmlDoc__tmp = xmlEntity(_obj = ret)
  4739.         return _xmlDoc__tmp
  4740.  
  4741.     
  4742.     def relaxNGNewDocParserCtxt(self):
  4743.         '''Create an XML RelaxNGs parser context for that document.
  4744.           Note: since the process of compiling a RelaxNG schemas
  4745.           modifies the document, the @doc parameter is duplicated
  4746.            internally. '''
  4747.         ret = libxml2mod.xmlRelaxNGNewDocParserCtxt(self._o)
  4748.         if ret is None:
  4749.             raise parserError('xmlRelaxNGNewDocParserCtxt() failed')
  4750.         ret is None
  4751.         _xmlDoc__tmp = relaxNgParserCtxt(_obj = ret)
  4752.         return _xmlDoc__tmp
  4753.  
  4754.     
  4755.     def relaxNGValidateDoc(self, ctxt):
  4756.         '''Validate a document tree in memory. '''
  4757.         if ctxt is None:
  4758.             ctxt__o = None
  4759.         else:
  4760.             ctxt__o = ctxt._o
  4761.         ret = libxml2mod.xmlRelaxNGValidateDoc(ctxt__o, self._o)
  4762.         return ret
  4763.  
  4764.     
  4765.     def relaxNGValidateFullElement(self, ctxt, elem):
  4766.         '''Validate a full subtree when
  4767.           xmlRelaxNGValidatePushElement() returned 0 and the content
  4768.            of the node has been expanded. '''
  4769.         if ctxt is None:
  4770.             ctxt__o = None
  4771.         else:
  4772.             ctxt__o = ctxt._o
  4773.         if elem is None:
  4774.             elem__o = None
  4775.         else:
  4776.             elem__o = elem._o
  4777.         ret = libxml2mod.xmlRelaxNGValidateFullElement(ctxt__o, self._o, elem__o)
  4778.         return ret
  4779.  
  4780.     
  4781.     def relaxNGValidatePopElement(self, ctxt, elem):
  4782.         '''Pop the element end from the RelaxNG validation stack. '''
  4783.         if ctxt is None:
  4784.             ctxt__o = None
  4785.         else:
  4786.             ctxt__o = ctxt._o
  4787.         if elem is None:
  4788.             elem__o = None
  4789.         else:
  4790.             elem__o = elem._o
  4791.         ret = libxml2mod.xmlRelaxNGValidatePopElement(ctxt__o, self._o, elem__o)
  4792.         return ret
  4793.  
  4794.     
  4795.     def relaxNGValidatePushElement(self, ctxt, elem):
  4796.         '''Push a new element start on the RelaxNG validation stack. '''
  4797.         if ctxt is None:
  4798.             ctxt__o = None
  4799.         else:
  4800.             ctxt__o = ctxt._o
  4801.         if elem is None:
  4802.             elem__o = None
  4803.         else:
  4804.             elem__o = elem._o
  4805.         ret = libxml2mod.xmlRelaxNGValidatePushElement(ctxt__o, self._o, elem__o)
  4806.         return ret
  4807.  
  4808.     
  4809.     def copyDoc(self, recursive):
  4810.         '''Do a copy of the document info. If recursive, the content
  4811.           tree will be copied too as well as DTD, namespaces and
  4812.            entities. '''
  4813.         ret = libxml2mod.xmlCopyDoc(self._o, recursive)
  4814.         if ret is None:
  4815.             raise treeError('xmlCopyDoc() failed')
  4816.         ret is None
  4817.         _xmlDoc__tmp = xmlDoc(_obj = ret)
  4818.         return _xmlDoc__tmp
  4819.  
  4820.     
  4821.     def copyNode(self, node, extended):
  4822.         '''Do a copy of the node to a given document. '''
  4823.         if node is None:
  4824.             node__o = None
  4825.         else:
  4826.             node__o = node._o
  4827.         ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended)
  4828.         if ret is None:
  4829.             raise treeError('xmlDocCopyNode() failed')
  4830.         ret is None
  4831.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4832.         return _xmlDoc__tmp
  4833.  
  4834.     
  4835.     def copyNodeList(self, node):
  4836.         '''Do a recursive copy of the node list. '''
  4837.         if node is None:
  4838.             node__o = None
  4839.         else:
  4840.             node__o = node._o
  4841.         ret = libxml2mod.xmlDocCopyNodeList(self._o, node__o)
  4842.         if ret is None:
  4843.             raise treeError('xmlDocCopyNodeList() failed')
  4844.         ret is None
  4845.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4846.         return _xmlDoc__tmp
  4847.  
  4848.     
  4849.     def createIntSubset(self, name, ExternalID, SystemID):
  4850.         '''Create the internal subset of a document '''
  4851.         ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID)
  4852.         if ret is None:
  4853.             raise treeError('xmlCreateIntSubset() failed')
  4854.         ret is None
  4855.         _xmlDoc__tmp = xmlDtd(_obj = ret)
  4856.         return _xmlDoc__tmp
  4857.  
  4858.     
  4859.     def docCompressMode(self):
  4860.         '''get the compression ratio for a document, ZLIB based '''
  4861.         ret = libxml2mod.xmlGetDocCompressMode(self._o)
  4862.         return ret
  4863.  
  4864.     
  4865.     def dump(self, f):
  4866.         '''Dump an XML document to an open FILE. '''
  4867.         ret = libxml2mod.xmlDocDump(f, self._o)
  4868.         return ret
  4869.  
  4870.     
  4871.     def elemDump(self, f, cur):
  4872.         '''Dump an XML/HTML node, recursive behaviour, children are
  4873.            printed too. '''
  4874.         if cur is None:
  4875.             cur__o = None
  4876.         else:
  4877.             cur__o = cur._o
  4878.         libxml2mod.xmlElemDump(f, self._o, cur__o)
  4879.  
  4880.     
  4881.     def formatDump(self, f, format):
  4882.         '''Dump an XML document to an open FILE. '''
  4883.         ret = libxml2mod.xmlDocFormatDump(f, self._o, format)
  4884.         return ret
  4885.  
  4886.     
  4887.     def freeDoc(self):
  4888.         '''Free up all the structures used by a document, tree
  4889.            included. '''
  4890.         libxml2mod.xmlFreeDoc(self._o)
  4891.  
  4892.     
  4893.     def getRootElement(self):
  4894.         '''Get the root element of the document (doc->children is a
  4895.            list containing possibly comments, PIs, etc ...). '''
  4896.         ret = libxml2mod.xmlDocGetRootElement(self._o)
  4897.         if ret is None:
  4898.             raise treeError('xmlDocGetRootElement() failed')
  4899.         ret is None
  4900.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4901.         return _xmlDoc__tmp
  4902.  
  4903.     
  4904.     def intSubset(self):
  4905.         '''Get the internal subset of a document '''
  4906.         ret = libxml2mod.xmlGetIntSubset(self._o)
  4907.         if ret is None:
  4908.             raise treeError('xmlGetIntSubset() failed')
  4909.         ret is None
  4910.         _xmlDoc__tmp = xmlDtd(_obj = ret)
  4911.         return _xmlDoc__tmp
  4912.  
  4913.     
  4914.     def newCDataBlock(self, content, len):
  4915.         '''Creation of a new node containing a CDATA block. '''
  4916.         ret = libxml2mod.xmlNewCDataBlock(self._o, content, len)
  4917.         if ret is None:
  4918.             raise treeError('xmlNewCDataBlock() failed')
  4919.         ret is None
  4920.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4921.         return _xmlDoc__tmp
  4922.  
  4923.     
  4924.     def newCharRef(self, name):
  4925.         '''Creation of a new character reference node. '''
  4926.         ret = libxml2mod.xmlNewCharRef(self._o, name)
  4927.         if ret is None:
  4928.             raise treeError('xmlNewCharRef() failed')
  4929.         ret is None
  4930.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4931.         return _xmlDoc__tmp
  4932.  
  4933.     
  4934.     def newDocComment(self, content):
  4935.         '''Creation of a new node containing a comment within a
  4936.            document. '''
  4937.         ret = libxml2mod.xmlNewDocComment(self._o, content)
  4938.         if ret is None:
  4939.             raise treeError('xmlNewDocComment() failed')
  4940.         ret is None
  4941.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4942.         return _xmlDoc__tmp
  4943.  
  4944.     
  4945.     def newDocFragment(self):
  4946.         '''Creation of a new Fragment node. '''
  4947.         ret = libxml2mod.xmlNewDocFragment(self._o)
  4948.         if ret is None:
  4949.             raise treeError('xmlNewDocFragment() failed')
  4950.         ret is None
  4951.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4952.         return _xmlDoc__tmp
  4953.  
  4954.     
  4955.     def newDocNode(self, ns, name, content):
  4956.         """Creation of a new node element within a document. @ns and
  4957.           @content are optional (None). NOTE: @content is supposed to
  4958.           be a piece of XML CDATA, so it allow entities references,
  4959.           but XML special chars need to be escaped first by using
  4960.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  4961.            don't need entities support. """
  4962.         if ns is None:
  4963.             ns__o = None
  4964.         else:
  4965.             ns__o = ns._o
  4966.         ret = libxml2mod.xmlNewDocNode(self._o, ns__o, name, content)
  4967.         if ret is None:
  4968.             raise treeError('xmlNewDocNode() failed')
  4969.         ret is None
  4970.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4971.         return _xmlDoc__tmp
  4972.  
  4973.     
  4974.     def newDocNodeEatName(self, ns, name, content):
  4975.         """Creation of a new node element within a document. @ns and
  4976.           @content are optional (None). NOTE: @content is supposed to
  4977.           be a piece of XML CDATA, so it allow entities references,
  4978.           but XML special chars need to be escaped first by using
  4979.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  4980.            don't need entities support. """
  4981.         if ns is None:
  4982.             ns__o = None
  4983.         else:
  4984.             ns__o = ns._o
  4985.         ret = libxml2mod.xmlNewDocNodeEatName(self._o, ns__o, name, content)
  4986.         if ret is None:
  4987.             raise treeError('xmlNewDocNodeEatName() failed')
  4988.         ret is None
  4989.         _xmlDoc__tmp = xmlNode(_obj = ret)
  4990.         return _xmlDoc__tmp
  4991.  
  4992.     
  4993.     def newDocPI(self, name, content):
  4994.         '''Creation of a processing instruction element. '''
  4995.         ret = libxml2mod.xmlNewDocPI(self._o, name, content)
  4996.         if ret is None:
  4997.             raise treeError('xmlNewDocPI() failed')
  4998.         ret is None
  4999.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5000.         return _xmlDoc__tmp
  5001.  
  5002.     
  5003.     def newDocProp(self, name, value):
  5004.         '''Create a new property carried by a document. '''
  5005.         ret = libxml2mod.xmlNewDocProp(self._o, name, value)
  5006.         if ret is None:
  5007.             raise treeError('xmlNewDocProp() failed')
  5008.         ret is None
  5009.         _xmlDoc__tmp = xmlAttr(_obj = ret)
  5010.         return _xmlDoc__tmp
  5011.  
  5012.     
  5013.     def newDocRawNode(self, ns, name, content):
  5014.         '''Creation of a new node element within a document. @ns and
  5015.            @content are optional (None). '''
  5016.         if ns is None:
  5017.             ns__o = None
  5018.         else:
  5019.             ns__o = ns._o
  5020.         ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content)
  5021.         if ret is None:
  5022.             raise treeError('xmlNewDocRawNode() failed')
  5023.         ret is None
  5024.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5025.         return _xmlDoc__tmp
  5026.  
  5027.     
  5028.     def newDocText(self, content):
  5029.         '''Creation of a new text node within a document. '''
  5030.         ret = libxml2mod.xmlNewDocText(self._o, content)
  5031.         if ret is None:
  5032.             raise treeError('xmlNewDocText() failed')
  5033.         ret is None
  5034.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5035.         return _xmlDoc__tmp
  5036.  
  5037.     
  5038.     def newDocTextLen(self, content, len):
  5039.         '''Creation of a new text node with an extra content length
  5040.            parameter. The text node pertain to a given document. '''
  5041.         ret = libxml2mod.xmlNewDocTextLen(self._o, content, len)
  5042.         if ret is None:
  5043.             raise treeError('xmlNewDocTextLen() failed')
  5044.         ret is None
  5045.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5046.         return _xmlDoc__tmp
  5047.  
  5048.     
  5049.     def newDtd(self, name, ExternalID, SystemID):
  5050.         '''Creation of a new DTD for the external subset. To create an
  5051.            internal subset, use xmlCreateIntSubset(). '''
  5052.         ret = libxml2mod.xmlNewDtd(self._o, name, ExternalID, SystemID)
  5053.         if ret is None:
  5054.             raise treeError('xmlNewDtd() failed')
  5055.         ret is None
  5056.         _xmlDoc__tmp = xmlDtd(_obj = ret)
  5057.         return _xmlDoc__tmp
  5058.  
  5059.     
  5060.     def newGlobalNs(self, href, prefix):
  5061.         '''Creation of a Namespace, the old way using PI and without
  5062.            scoping DEPRECATED !!! '''
  5063.         ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix)
  5064.         if ret is None:
  5065.             raise treeError('xmlNewGlobalNs() failed')
  5066.         ret is None
  5067.         _xmlDoc__tmp = xmlNs(_obj = ret)
  5068.         return _xmlDoc__tmp
  5069.  
  5070.     
  5071.     def newReference(self, name):
  5072.         '''Creation of a new reference node. '''
  5073.         ret = libxml2mod.xmlNewReference(self._o, name)
  5074.         if ret is None:
  5075.             raise treeError('xmlNewReference() failed')
  5076.         ret is None
  5077.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5078.         return _xmlDoc__tmp
  5079.  
  5080.     
  5081.     def nodeDumpOutput(self, buf, cur, level, format, encoding):
  5082.         '''Dump an XML node, recursive behaviour, children are printed
  5083.           too. Note that @format = 1 provide node indenting only if
  5084.           xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
  5085.            called '''
  5086.         if buf is None:
  5087.             buf__o = None
  5088.         else:
  5089.             buf__o = buf._o
  5090.         if cur is None:
  5091.             cur__o = None
  5092.         else:
  5093.             cur__o = cur._o
  5094.         libxml2mod.xmlNodeDumpOutput(buf__o, self._o, cur__o, level, format, encoding)
  5095.  
  5096.     
  5097.     def nodeGetBase(self, cur):
  5098.         '''Searches for the BASE URL. The code should work on both XML
  5099.           and HTML document even if base mechanisms are completely
  5100.           different. It returns the base as defined in RFC 2396
  5101.           sections 5.1.1. Base URI within Document Content and 5.1.2.
  5102.           Base URI from the Encapsulating Entity However it does not
  5103.           return the document base (5.1.3), use xmlDocumentGetBase()
  5104.            for this '''
  5105.         if cur is None:
  5106.             cur__o = None
  5107.         else:
  5108.             cur__o = cur._o
  5109.         ret = libxml2mod.xmlNodeGetBase(self._o, cur__o)
  5110.         return ret
  5111.  
  5112.     
  5113.     def nodeListGetRawString(self, list, inLine):
  5114.         """Builds the string equivalent to the text contained in the
  5115.           Node list made of TEXTs and ENTITY_REFs, contrary to
  5116.           xmlNodeListGetString() this function doesn't do any
  5117.            character encoding handling. """
  5118.         if list is None:
  5119.             list__o = None
  5120.         else:
  5121.             list__o = list._o
  5122.         ret = libxml2mod.xmlNodeListGetRawString(self._o, list__o, inLine)
  5123.         return ret
  5124.  
  5125.     
  5126.     def nodeListGetString(self, list, inLine):
  5127.         '''Build the string equivalent to the text contained in the
  5128.            Node list made of TEXTs and ENTITY_REFs '''
  5129.         if list is None:
  5130.             list__o = None
  5131.         else:
  5132.             list__o = list._o
  5133.         ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
  5134.         return ret
  5135.  
  5136.     
  5137.     def reconciliateNs(self, tree):
  5138.         '''This function checks that all the namespaces declared
  5139.           within the given tree are properly declared. This is needed
  5140.           for example after Copy or Cut and then paste operations.
  5141.           The subtree may still hold pointers to namespace
  5142.           declarations outside the subtree or invalid/masked. As much
  5143.           as possible the function try to reuse the existing
  5144.           namespaces found in the new environment. If not possible
  5145.           the new namespaces are redeclared on @tree at the top of
  5146.            the given subtree. '''
  5147.         if tree is None:
  5148.             tree__o = None
  5149.         else:
  5150.             tree__o = tree._o
  5151.         ret = libxml2mod.xmlReconciliateNs(self._o, tree__o)
  5152.         return ret
  5153.  
  5154.     
  5155.     def saveFile(self, filename):
  5156.         '''Dump an XML document to a file. Will use compression if
  5157.           compiled in and enabled. If @filename is "-" the stdout
  5158.            file is used. '''
  5159.         ret = libxml2mod.xmlSaveFile(filename, self._o)
  5160.         return ret
  5161.  
  5162.     
  5163.     def saveFileEnc(self, filename, encoding):
  5164.         '''Dump an XML document, converting it to the given encoding '''
  5165.         ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding)
  5166.         return ret
  5167.  
  5168.     
  5169.     def saveFileTo(self, buf, encoding):
  5170.         '''Dump an XML document to an I/O buffer. Warning ! This call
  5171.           xmlOutputBufferClose() on buf which is not available after
  5172.            this call. '''
  5173.         if buf is None:
  5174.             buf__o = None
  5175.         else:
  5176.             buf__o = buf._o
  5177.         ret = libxml2mod.xmlSaveFileTo(buf__o, self._o, encoding)
  5178.         return ret
  5179.  
  5180.     
  5181.     def saveFormatFile(self, filename, format):
  5182.         '''Dump an XML document to a file. Will use compression if
  5183.           compiled in and enabled. If @filename is "-" the stdout
  5184.           file is used. If @format is set then the document will be
  5185.           indented on output. Note that @format = 1 provide node
  5186.           indenting only if xmlIndentTreeOutput = 1 or
  5187.            xmlKeepBlanksDefault(0) was called '''
  5188.         ret = libxml2mod.xmlSaveFormatFile(filename, self._o, format)
  5189.         return ret
  5190.  
  5191.     
  5192.     def saveFormatFileEnc(self, filename, encoding, format):
  5193.         '''Dump an XML document to a file or an URL. '''
  5194.         ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format)
  5195.         return ret
  5196.  
  5197.     
  5198.     def saveFormatFileTo(self, buf, encoding, format):
  5199.         '''Dump an XML document to an I/O buffer. Warning ! This call
  5200.           xmlOutputBufferClose() on buf which is not available after
  5201.            this call. '''
  5202.         if buf is None:
  5203.             buf__o = None
  5204.         else:
  5205.             buf__o = buf._o
  5206.         ret = libxml2mod.xmlSaveFormatFileTo(buf__o, self._o, encoding, format)
  5207.         return ret
  5208.  
  5209.     
  5210.     def searchNs(self, node, nameSpace):
  5211.         """Search a Ns registered under a given name space for a
  5212.           document. recurse on the parents until it finds the defined
  5213.           namespace or return None otherwise. @nameSpace can be None,
  5214.           this is a search for the default namespace. We don't allow
  5215.           to cross entities boundaries. If you don't declare the
  5216.           namespace within those you will be in troubles !!! A
  5217.            warning is generated to cover this case. """
  5218.         if node is None:
  5219.             node__o = None
  5220.         else:
  5221.             node__o = node._o
  5222.         ret = libxml2mod.xmlSearchNs(self._o, node__o, nameSpace)
  5223.         if ret is None:
  5224.             raise treeError('xmlSearchNs() failed')
  5225.         ret is None
  5226.         _xmlDoc__tmp = xmlNs(_obj = ret)
  5227.         return _xmlDoc__tmp
  5228.  
  5229.     
  5230.     def searchNsByHref(self, node, href):
  5231.         '''Search a Ns aliasing a given URI. Recurse on the parents
  5232.           until it finds the defined namespace or return None
  5233.            otherwise. '''
  5234.         if node is None:
  5235.             node__o = None
  5236.         else:
  5237.             node__o = node._o
  5238.         ret = libxml2mod.xmlSearchNsByHref(self._o, node__o, href)
  5239.         if ret is None:
  5240.             raise treeError('xmlSearchNsByHref() failed')
  5241.         ret is None
  5242.         _xmlDoc__tmp = xmlNs(_obj = ret)
  5243.         return _xmlDoc__tmp
  5244.  
  5245.     
  5246.     def setDocCompressMode(self, mode):
  5247.         '''set the compression ratio for a document, ZLIB based
  5248.            Correct values: 0 (uncompressed) to 9 (max compression) '''
  5249.         libxml2mod.xmlSetDocCompressMode(self._o, mode)
  5250.  
  5251.     
  5252.     def setListDoc(self, list):
  5253.         '''update all nodes in the list to point to the right document '''
  5254.         if list is None:
  5255.             list__o = None
  5256.         else:
  5257.             list__o = list._o
  5258.         libxml2mod.xmlSetListDoc(list__o, self._o)
  5259.  
  5260.     
  5261.     def setRootElement(self, root):
  5262.         '''Set the root element of the document (doc->children is a
  5263.            list containing possibly comments, PIs, etc ...). '''
  5264.         if root is None:
  5265.             root__o = None
  5266.         else:
  5267.             root__o = root._o
  5268.         ret = libxml2mod.xmlDocSetRootElement(self._o, root__o)
  5269.         if ret is None:
  5270.             return None
  5271.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5272.         return _xmlDoc__tmp
  5273.  
  5274.     
  5275.     def setTreeDoc(self, tree):
  5276.         '''update all nodes under the tree to point to the right
  5277.            document '''
  5278.         if tree is None:
  5279.             tree__o = None
  5280.         else:
  5281.             tree__o = tree._o
  5282.         libxml2mod.xmlSetTreeDoc(tree__o, self._o)
  5283.  
  5284.     
  5285.     def stringGetNodeList(self, value):
  5286.         '''Parse the value string and build the node list associated.
  5287.            Should produce a flat tree with only TEXTs and ENTITY_REFs. '''
  5288.         ret = libxml2mod.xmlStringGetNodeList(self._o, value)
  5289.         if ret is None:
  5290.             raise treeError('xmlStringGetNodeList() failed')
  5291.         ret is None
  5292.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5293.         return _xmlDoc__tmp
  5294.  
  5295.     
  5296.     def stringLenGetNodeList(self, value, len):
  5297.         '''Parse the value string and build the node list associated.
  5298.            Should produce a flat tree with only TEXTs and ENTITY_REFs. '''
  5299.         ret = libxml2mod.xmlStringLenGetNodeList(self._o, value, len)
  5300.         if ret is None:
  5301.             raise treeError('xmlStringLenGetNodeList() failed')
  5302.         ret is None
  5303.         _xmlDoc__tmp = xmlNode(_obj = ret)
  5304.         return _xmlDoc__tmp
  5305.  
  5306.     
  5307.     def ID(self, ID):
  5308.         '''Search the attribute declaring the given ID '''
  5309.         ret = libxml2mod.xmlGetID(self._o, ID)
  5310.         if ret is None:
  5311.             raise treeError('xmlGetID() failed')
  5312.         ret is None
  5313.         _xmlDoc__tmp = xmlAttr(_obj = ret)
  5314.         return _xmlDoc__tmp
  5315.  
  5316.     
  5317.     def isID(self, elem, attr):
  5318.         '''Determine whether an attribute is of type ID. In case we
  5319.           have DTD(s) then this is done if DTD loading has been
  5320.           requested. In the case of HTML documents parsed with the
  5321.            HTML parser, then ID detection is done systematically. '''
  5322.         if elem is None:
  5323.             elem__o = None
  5324.         else:
  5325.             elem__o = elem._o
  5326.         if attr is None:
  5327.             attr__o = None
  5328.         else:
  5329.             attr__o = attr._o
  5330.         ret = libxml2mod.xmlIsID(self._o, elem__o, attr__o)
  5331.         return ret
  5332.  
  5333.     
  5334.     def isMixedElement(self, name):
  5335.         '''Search in the DtDs whether an element accept Mixed content
  5336.            (or ANY) basically if it is supposed to accept text childs '''
  5337.         ret = libxml2mod.xmlIsMixedElement(self._o, name)
  5338.         return ret
  5339.  
  5340.     
  5341.     def isRef(self, elem, attr):
  5342.         '''Determine whether an attribute is of type Ref. In case we
  5343.           have DTD(s) then this is simple, otherwise we use an
  5344.            heuristic: name Ref (upper or lowercase). '''
  5345.         if elem is None:
  5346.             elem__o = None
  5347.         else:
  5348.             elem__o = elem._o
  5349.         if attr is None:
  5350.             attr__o = None
  5351.         else:
  5352.             attr__o = attr._o
  5353.         ret = libxml2mod.xmlIsRef(self._o, elem__o, attr__o)
  5354.         return ret
  5355.  
  5356.     
  5357.     def removeID(self, attr):
  5358.         '''Remove the given attribute from the ID table maintained
  5359.            internally. '''
  5360.         if attr is None:
  5361.             attr__o = None
  5362.         else:
  5363.             attr__o = attr._o
  5364.         ret = libxml2mod.xmlRemoveID(self._o, attr__o)
  5365.         return ret
  5366.  
  5367.     
  5368.     def removeRef(self, attr):
  5369.         '''Remove the given attribute from the Ref table maintained
  5370.            internally. '''
  5371.         if attr is None:
  5372.             attr__o = None
  5373.         else:
  5374.             attr__o = attr._o
  5375.         ret = libxml2mod.xmlRemoveRef(self._o, attr__o)
  5376.         return ret
  5377.  
  5378.     
  5379.     def validCtxtNormalizeAttributeValue(self, ctxt, elem, name, value):
  5380.         '''Does the validation related extra step of the normalization
  5381.           of attribute values:  If the declared value is not CDATA,
  5382.           then the XML processor must further process the normalized
  5383.           attribute value by discarding any leading and trailing
  5384.           space (#x20) characters, and by replacing sequences of
  5385.           space (#x20) characters by single space (#x20) character. 
  5386.           Also  check VC: Standalone Document Declaration in P32, and
  5387.            update ctxt->valid accordingly '''
  5388.         if ctxt is None:
  5389.             ctxt__o = None
  5390.         else:
  5391.             ctxt__o = ctxt._o
  5392.         if elem is None:
  5393.             elem__o = None
  5394.         else:
  5395.             elem__o = elem._o
  5396.         ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(ctxt__o, self._o, elem__o, name, value)
  5397.         return ret
  5398.  
  5399.     
  5400.     def validNormalizeAttributeValue(self, elem, name, value):
  5401.         '''Does the validation related extra step of the normalization
  5402.           of attribute values:  If the declared value is not CDATA,
  5403.           then the XML processor must further process the normalized
  5404.           attribute value by discarding any leading and trailing
  5405.           space (#x20) characters, and by replacing sequences of
  5406.            space (#x20) characters by single space (#x20) character. '''
  5407.         if elem is None:
  5408.             elem__o = None
  5409.         else:
  5410.             elem__o = elem._o
  5411.         ret = libxml2mod.xmlValidNormalizeAttributeValue(self._o, elem__o, name, value)
  5412.         return ret
  5413.  
  5414.     
  5415.     def validateDocument(self, ctxt):
  5416.         '''Try to validate the document instance  basically it does
  5417.           the all the checks described by the XML Rec i.e. validates
  5418.           the internal and external subset (if present) and validate
  5419.            the document tree. '''
  5420.         if ctxt is None:
  5421.             ctxt__o = None
  5422.         else:
  5423.             ctxt__o = ctxt._o
  5424.         ret = libxml2mod.xmlValidateDocument(ctxt__o, self._o)
  5425.         return ret
  5426.  
  5427.     
  5428.     def validateDocumentFinal(self, ctxt):
  5429.         '''Does the final step for the document validation once all
  5430.           the incremental validation steps have been completed 
  5431.           basically it does the following checks described by the XML
  5432.           Rec  Check all the IDREF/IDREFS attributes definition for
  5433.            validity '''
  5434.         if ctxt is None:
  5435.             ctxt__o = None
  5436.         else:
  5437.             ctxt__o = ctxt._o
  5438.         ret = libxml2mod.xmlValidateDocumentFinal(ctxt__o, self._o)
  5439.         return ret
  5440.  
  5441.     
  5442.     def validateDtd(self, ctxt, dtd):
  5443.         '''Try to validate the document against the dtd instance 
  5444.           Basically it does check all the definitions in the DtD.
  5445.           Note the the internal subset (if present) is de-coupled
  5446.           (i.e. not used), which could give problems if ID or IDREF
  5447.            is present. '''
  5448.         if ctxt is None:
  5449.             ctxt__o = None
  5450.         else:
  5451.             ctxt__o = ctxt._o
  5452.         if dtd is None:
  5453.             dtd__o = None
  5454.         else:
  5455.             dtd__o = dtd._o
  5456.         ret = libxml2mod.xmlValidateDtd(ctxt__o, self._o, dtd__o)
  5457.         return ret
  5458.  
  5459.     
  5460.     def validateDtdFinal(self, ctxt):
  5461.         '''Does the final step for the dtds validation once all the
  5462.           subsets have been parsed  basically it does the following
  5463.           checks described by the XML Rec - check that ENTITY and
  5464.           ENTITIES type attributes default or possible values matches
  5465.           one of the defined entities. - check that NOTATION type
  5466.           attributes default or possible values matches one of the
  5467.            defined notations. '''
  5468.         if ctxt is None:
  5469.             ctxt__o = None
  5470.         else:
  5471.             ctxt__o = ctxt._o
  5472.         ret = libxml2mod.xmlValidateDtdFinal(ctxt__o, self._o)
  5473.         return ret
  5474.  
  5475.     
  5476.     def validateElement(self, ctxt, elem):
  5477.         '''Try to validate the subtree under an element '''
  5478.         if ctxt is None:
  5479.             ctxt__o = None
  5480.         else:
  5481.             ctxt__o = ctxt._o
  5482.         if elem is None:
  5483.             elem__o = None
  5484.         else:
  5485.             elem__o = elem._o
  5486.         ret = libxml2mod.xmlValidateElement(ctxt__o, self._o, elem__o)
  5487.         return ret
  5488.  
  5489.     
  5490.     def validateNotationUse(self, ctxt, notationName):
  5491.         '''Validate that the given name match a notation declaration.
  5492.            - [ VC: Notation Declared ] '''
  5493.         if ctxt is None:
  5494.             ctxt__o = None
  5495.         else:
  5496.             ctxt__o = ctxt._o
  5497.         ret = libxml2mod.xmlValidateNotationUse(ctxt__o, self._o, notationName)
  5498.         return ret
  5499.  
  5500.     
  5501.     def validateOneAttribute(self, ctxt, elem, attr, value):
  5502.         '''Try to validate a single attribute for an element basically
  5503.           it does the following checks as described by the XML-1.0
  5504.           recommendation: - [ VC: Attribute Value Type ] - [ VC:
  5505.           Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
  5506.           Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
  5507.           Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  5508.            uniqueness and matching are done separately '''
  5509.         if ctxt is None:
  5510.             ctxt__o = None
  5511.         else:
  5512.             ctxt__o = ctxt._o
  5513.         if elem is None:
  5514.             elem__o = None
  5515.         else:
  5516.             elem__o = elem._o
  5517.         if attr is None:
  5518.             attr__o = None
  5519.         else:
  5520.             attr__o = attr._o
  5521.         ret = libxml2mod.xmlValidateOneAttribute(ctxt__o, self._o, elem__o, attr__o, value)
  5522.         return ret
  5523.  
  5524.     
  5525.     def validateOneElement(self, ctxt, elem):
  5526.         """Try to validate a single element and it's attributes,
  5527.           basically it does the following checks as described by the
  5528.           XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
  5529.           Required Attribute ] Then call xmlValidateOneAttribute()
  5530.           for each attribute present.  The ID/IDREF checkings are
  5531.            done separately """
  5532.         if ctxt is None:
  5533.             ctxt__o = None
  5534.         else:
  5535.             ctxt__o = ctxt._o
  5536.         if elem is None:
  5537.             elem__o = None
  5538.         else:
  5539.             elem__o = elem._o
  5540.         ret = libxml2mod.xmlValidateOneElement(ctxt__o, self._o, elem__o)
  5541.         return ret
  5542.  
  5543.     
  5544.     def validateOneNamespace(self, ctxt, elem, prefix, ns, value):
  5545.         '''Try to validate a single namespace declaration for an
  5546.           element basically it does the following checks as described
  5547.           by the XML-1.0 recommendation: - [ VC: Attribute Value Type
  5548.           ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
  5549.           [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
  5550.           Entity Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  5551.            uniqueness and matching are done separately '''
  5552.         if ctxt is None:
  5553.             ctxt__o = None
  5554.         else:
  5555.             ctxt__o = ctxt._o
  5556.         if elem is None:
  5557.             elem__o = None
  5558.         else:
  5559.             elem__o = elem._o
  5560.         if ns is None:
  5561.             ns__o = None
  5562.         else:
  5563.             ns__o = ns._o
  5564.         ret = libxml2mod.xmlValidateOneNamespace(ctxt__o, self._o, elem__o, prefix, ns__o, value)
  5565.         return ret
  5566.  
  5567.     
  5568.     def validatePopElement(self, ctxt, elem, qname):
  5569.         '''Pop the element end from the validation stack. '''
  5570.         if ctxt is None:
  5571.             ctxt__o = None
  5572.         else:
  5573.             ctxt__o = ctxt._o
  5574.         if elem is None:
  5575.             elem__o = None
  5576.         else:
  5577.             elem__o = elem._o
  5578.         ret = libxml2mod.xmlValidatePopElement(ctxt__o, self._o, elem__o, qname)
  5579.         return ret
  5580.  
  5581.     
  5582.     def validatePushElement(self, ctxt, elem, qname):
  5583.         '''Push a new element start on the validation stack. '''
  5584.         if ctxt is None:
  5585.             ctxt__o = None
  5586.         else:
  5587.             ctxt__o = ctxt._o
  5588.         if elem is None:
  5589.             elem__o = None
  5590.         else:
  5591.             elem__o = elem._o
  5592.         ret = libxml2mod.xmlValidatePushElement(ctxt__o, self._o, elem__o, qname)
  5593.         return ret
  5594.  
  5595.     
  5596.     def validateRoot(self, ctxt):
  5597.         """Try to validate a the root element basically it does the
  5598.           following check as described by the XML-1.0 recommendation:
  5599.           - [ VC: Root Element Type ] it doesn't try to recurse or
  5600.            apply other check to the element """
  5601.         if ctxt is None:
  5602.             ctxt__o = None
  5603.         else:
  5604.             ctxt__o = ctxt._o
  5605.         ret = libxml2mod.xmlValidateRoot(ctxt__o, self._o)
  5606.         return ret
  5607.  
  5608.     
  5609.     def xincludeProcess(self):
  5610.         '''Implement the XInclude substitution on the XML document @doc '''
  5611.         ret = libxml2mod.xmlXIncludeProcess(self._o)
  5612.         return ret
  5613.  
  5614.     
  5615.     def xincludeProcessFlags(self, flags):
  5616.         '''Implement the XInclude substitution on the XML document @doc '''
  5617.         ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
  5618.         return ret
  5619.  
  5620.     
  5621.     def NewWalker(self, reader):
  5622.         '''Setup an xmltextReader to parse a preparsed XML document.
  5623.            This reuses the existing @reader xmlTextReader. '''
  5624.         if reader is None:
  5625.             reader__o = None
  5626.         else:
  5627.             reader__o = reader._o
  5628.         ret = libxml2mod.xmlReaderNewWalker(reader__o, self._o)
  5629.         return ret
  5630.  
  5631.     
  5632.     def readerWalker(self):
  5633.         '''Create an xmltextReader for a preparsed document. '''
  5634.         ret = libxml2mod.xmlReaderWalker(self._o)
  5635.         if ret is None:
  5636.             raise treeError('xmlReaderWalker() failed')
  5637.         ret is None
  5638.         _xmlDoc__tmp = xmlTextReader(_obj = ret)
  5639.         return _xmlDoc__tmp
  5640.  
  5641.     
  5642.     def schemaNewDocParserCtxt(self):
  5643.         '''Create an XML Schemas parse context for that document. NB.
  5644.            The document may be modified during the parsing process. '''
  5645.         ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o)
  5646.         if ret is None:
  5647.             raise parserError('xmlSchemaNewDocParserCtxt() failed')
  5648.         ret is None
  5649.         _xmlDoc__tmp = SchemaParserCtxt(_obj = ret)
  5650.         return _xmlDoc__tmp
  5651.  
  5652.     
  5653.     def schemaValidateDoc(self, ctxt):
  5654.         if ctxt is None:
  5655.             ctxt__o = None
  5656.         else:
  5657.             ctxt__o = ctxt._o
  5658.         ret = libxml2mod.xmlSchemaValidateDoc(ctxt__o, self._o)
  5659.         return ret
  5660.  
  5661.     
  5662.     def xpathNewContext(self):
  5663.         '''Create a new xmlXPathContext '''
  5664.         ret = libxml2mod.xmlXPathNewContext(self._o)
  5665.         if ret is None:
  5666.             raise xpathError('xmlXPathNewContext() failed')
  5667.         ret is None
  5668.         _xmlDoc__tmp = xpathContext(_obj = ret)
  5669.         return _xmlDoc__tmp
  5670.  
  5671.     
  5672.     def xpathOrderDocElems(self):
  5673.         '''Call this routine to speed up XPath computation on static
  5674.           documents. This stamps all the element nodes with the
  5675.           document order Like for line information, the order is kept
  5676.           in the element->content field, the value stored is actually
  5677.           - the node number (starting at -1) to be able to
  5678.            differentiate from line numbers. '''
  5679.         ret = libxml2mod.xmlXPathOrderDocElems(self._o)
  5680.         return ret
  5681.  
  5682.     
  5683.     def xpointerNewContext(self, here, origin):
  5684.         '''Create a new XPointer context '''
  5685.         if here is None:
  5686.             here__o = None
  5687.         else:
  5688.             here__o = here._o
  5689.         if origin is None:
  5690.             origin__o = None
  5691.         else:
  5692.             origin__o = origin._o
  5693.         ret = libxml2mod.xmlXPtrNewContext(self._o, here__o, origin__o)
  5694.         if ret is None:
  5695.             raise treeError('xmlXPtrNewContext() failed')
  5696.         ret is None
  5697.         _xmlDoc__tmp = xpathContext(_obj = ret)
  5698.         return _xmlDoc__tmp
  5699.  
  5700.  
  5701.  
  5702. class xpathContext:
  5703.     
  5704.     def __init__(self, _obj = None):
  5705.         if _obj != None:
  5706.             self._o = _obj
  5707.             return None
  5708.         self._o = None
  5709.  
  5710.     
  5711.     def contextDoc(self):
  5712.         '''Get the doc from an xpathContext '''
  5713.         ret = libxml2mod.xmlXPathGetContextDoc(self._o)
  5714.         if ret is None:
  5715.             raise xpathError('xmlXPathGetContextDoc() failed')
  5716.         ret is None
  5717.         _xpathContext__tmp = xmlDoc(_obj = ret)
  5718.         return _xpathContext__tmp
  5719.  
  5720.     
  5721.     def contextNode(self):
  5722.         '''Get the current node from an xpathContext '''
  5723.         ret = libxml2mod.xmlXPathGetContextNode(self._o)
  5724.         if ret is None:
  5725.             raise xpathError('xmlXPathGetContextNode() failed')
  5726.         ret is None
  5727.         _xpathContext__tmp = xmlNode(_obj = ret)
  5728.         return _xpathContext__tmp
  5729.  
  5730.     
  5731.     def contextPosition(self):
  5732.         '''Get the current node from an xpathContext '''
  5733.         ret = libxml2mod.xmlXPathGetContextPosition(self._o)
  5734.         return ret
  5735.  
  5736.     
  5737.     def contextSize(self):
  5738.         '''Get the current node from an xpathContext '''
  5739.         ret = libxml2mod.xmlXPathGetContextSize(self._o)
  5740.         return ret
  5741.  
  5742.     
  5743.     def function(self):
  5744.         '''Get the current function name xpathContext '''
  5745.         ret = libxml2mod.xmlXPathGetFunction(self._o)
  5746.         return ret
  5747.  
  5748.     
  5749.     def functionURI(self):
  5750.         '''Get the current function name URI xpathContext '''
  5751.         ret = libxml2mod.xmlXPathGetFunctionURI(self._o)
  5752.         return ret
  5753.  
  5754.     
  5755.     def setContextDoc(self, doc):
  5756.         '''Set the doc of an xpathContext '''
  5757.         if doc is None:
  5758.             doc__o = None
  5759.         else:
  5760.             doc__o = doc._o
  5761.         libxml2mod.xmlXPathSetContextDoc(self._o, doc__o)
  5762.  
  5763.     
  5764.     def setContextNode(self, node):
  5765.         '''Set the current node of an xpathContext '''
  5766.         if node is None:
  5767.             node__o = None
  5768.         else:
  5769.             node__o = node._o
  5770.         libxml2mod.xmlXPathSetContextNode(self._o, node__o)
  5771.  
  5772.     
  5773.     def registerXPathFunction(self, name, ns_uri, f):
  5774.         '''Register a Python written function to the XPath interpreter '''
  5775.         ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
  5776.         return ret
  5777.  
  5778.     
  5779.     def xpathContextSetCache(self, active, value, options):
  5780.         '''Creates/frees an object cache on the XPath context. If
  5781.           activates XPath objects (xmlXPathObject) will be cached
  5782.           internally to be reused. @options: 0: This will set the
  5783.           XPath object caching: @value: This will set the maximum
  5784.           number of XPath objects to be cached per slot There are 5
  5785.           slots for: node-set, string, number, boolean, and misc
  5786.           objects. Use <0 for the default number (100). Other values
  5787.            for @options have currently no effect. '''
  5788.         ret = libxml2mod.xmlXPathContextSetCache(self._o, active, value, options)
  5789.         return ret
  5790.  
  5791.     
  5792.     def xpathEval(self, str):
  5793.         '''Evaluate the XPath Location Path in the given context. '''
  5794.         ret = libxml2mod.xmlXPathEval(str, self._o)
  5795.         if ret is None:
  5796.             raise xpathError('xmlXPathEval() failed')
  5797.         ret is None
  5798.         return xpathObjectRet(ret)
  5799.  
  5800.     
  5801.     def xpathEvalExpression(self, str):
  5802.         '''Evaluate the XPath expression in the given context. '''
  5803.         ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
  5804.         if ret is None:
  5805.             raise xpathError('xmlXPathEvalExpression() failed')
  5806.         ret is None
  5807.         return xpathObjectRet(ret)
  5808.  
  5809.     
  5810.     def xpathFreeContext(self):
  5811.         '''Free up an xmlXPathContext '''
  5812.         libxml2mod.xmlXPathFreeContext(self._o)
  5813.  
  5814.     
  5815.     def xpathNewParserContext(self, str):
  5816.         '''Create a new xmlXPathParserContext '''
  5817.         ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
  5818.         if ret is None:
  5819.             raise xpathError('xmlXPathNewParserContext() failed')
  5820.         ret is None
  5821.         _xpathContext__tmp = xpathParserContext(_obj = ret)
  5822.         return _xpathContext__tmp
  5823.  
  5824.     
  5825.     def xpathNsLookup(self, prefix):
  5826.         '''Search in the namespace declaration array of the context
  5827.            for the given namespace name associated to the given prefix '''
  5828.         ret = libxml2mod.xmlXPathNsLookup(self._o, prefix)
  5829.         return ret
  5830.  
  5831.     
  5832.     def xpathRegisterAllFunctions(self):
  5833.         '''Registers all default XPath functions in this context '''
  5834.         libxml2mod.xmlXPathRegisterAllFunctions(self._o)
  5835.  
  5836.     
  5837.     def xpathRegisterNs(self, prefix, ns_uri):
  5838.         '''Register a new namespace. If @ns_uri is None it unregisters
  5839.            the namespace '''
  5840.         ret = libxml2mod.xmlXPathRegisterNs(self._o, prefix, ns_uri)
  5841.         return ret
  5842.  
  5843.     
  5844.     def xpathRegisteredFuncsCleanup(self):
  5845.         '''Cleanup the XPath context data associated to registered
  5846.            functions '''
  5847.         libxml2mod.xmlXPathRegisteredFuncsCleanup(self._o)
  5848.  
  5849.     
  5850.     def xpathRegisteredNsCleanup(self):
  5851.         '''Cleanup the XPath context data associated to registered
  5852.            variables '''
  5853.         libxml2mod.xmlXPathRegisteredNsCleanup(self._o)
  5854.  
  5855.     
  5856.     def xpathRegisteredVariablesCleanup(self):
  5857.         '''Cleanup the XPath context data associated to registered
  5858.            variables '''
  5859.         libxml2mod.xmlXPathRegisteredVariablesCleanup(self._o)
  5860.  
  5861.     
  5862.     def xpathVariableLookup(self, name):
  5863.         '''Search in the Variable array of the context for the given
  5864.            variable value. '''
  5865.         ret = libxml2mod.xmlXPathVariableLookup(self._o, name)
  5866.         if ret is None:
  5867.             raise xpathError('xmlXPathVariableLookup() failed')
  5868.         ret is None
  5869.         return xpathObjectRet(ret)
  5870.  
  5871.     
  5872.     def xpathVariableLookupNS(self, name, ns_uri):
  5873.         '''Search in the Variable array of the context for the given
  5874.            variable value. '''
  5875.         ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri)
  5876.         if ret is None:
  5877.             raise xpathError('xmlXPathVariableLookupNS() failed')
  5878.         ret is None
  5879.         return xpathObjectRet(ret)
  5880.  
  5881.     
  5882.     def xpointerEval(self, str):
  5883.         '''Evaluate the XPath Location Path in the given context. '''
  5884.         ret = libxml2mod.xmlXPtrEval(str, self._o)
  5885.         if ret is None:
  5886.             raise treeError('xmlXPtrEval() failed')
  5887.         ret is None
  5888.         return xpathObjectRet(ret)
  5889.  
  5890.  
  5891.  
  5892. class xmlAttribute(xmlNode):
  5893.     
  5894.     def __init__(self, _obj = None):
  5895.         if type(_obj).__name__ != 'PyCObject':
  5896.             raise TypeError, 'xmlAttribute needs a PyCObject argument'
  5897.         type(_obj).__name__ != 'PyCObject'
  5898.         self._o = _obj
  5899.         xmlNode.__init__(self, _obj = _obj)
  5900.  
  5901.     
  5902.     def __repr__(self):
  5903.         return '<xmlAttribute (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  5904.  
  5905.  
  5906.  
  5907. class ValidCtxt(ValidCtxtCore):
  5908.     
  5909.     def __init__(self, _obj = None):
  5910.         self._o = _obj
  5911.         ValidCtxtCore.__init__(self, _obj = _obj)
  5912.  
  5913.     
  5914.     def __del__(self):
  5915.         if self._o != None:
  5916.             libxml2mod.xmlFreeValidCtxt(self._o)
  5917.         
  5918.         self._o = None
  5919.  
  5920.     
  5921.     def validCtxtNormalizeAttributeValue(self, doc, elem, name, value):
  5922.         '''Does the validation related extra step of the normalization
  5923.           of attribute values:  If the declared value is not CDATA,
  5924.           then the XML processor must further process the normalized
  5925.           attribute value by discarding any leading and trailing
  5926.           space (#x20) characters, and by replacing sequences of
  5927.           space (#x20) characters by single space (#x20) character. 
  5928.           Also  check VC: Standalone Document Declaration in P32, and
  5929.            update ctxt->valid accordingly '''
  5930.         if doc is None:
  5931.             doc__o = None
  5932.         else:
  5933.             doc__o = doc._o
  5934.         if elem is None:
  5935.             elem__o = None
  5936.         else:
  5937.             elem__o = elem._o
  5938.         ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(self._o, doc__o, elem__o, name, value)
  5939.         return ret
  5940.  
  5941.     
  5942.     def validateDocument(self, doc):
  5943.         '''Try to validate the document instance  basically it does
  5944.           the all the checks described by the XML Rec i.e. validates
  5945.           the internal and external subset (if present) and validate
  5946.            the document tree. '''
  5947.         if doc is None:
  5948.             doc__o = None
  5949.         else:
  5950.             doc__o = doc._o
  5951.         ret = libxml2mod.xmlValidateDocument(self._o, doc__o)
  5952.         return ret
  5953.  
  5954.     
  5955.     def validateDocumentFinal(self, doc):
  5956.         '''Does the final step for the document validation once all
  5957.           the incremental validation steps have been completed 
  5958.           basically it does the following checks described by the XML
  5959.           Rec  Check all the IDREF/IDREFS attributes definition for
  5960.            validity '''
  5961.         if doc is None:
  5962.             doc__o = None
  5963.         else:
  5964.             doc__o = doc._o
  5965.         ret = libxml2mod.xmlValidateDocumentFinal(self._o, doc__o)
  5966.         return ret
  5967.  
  5968.     
  5969.     def validateDtd(self, doc, dtd):
  5970.         '''Try to validate the document against the dtd instance 
  5971.           Basically it does check all the definitions in the DtD.
  5972.           Note the the internal subset (if present) is de-coupled
  5973.           (i.e. not used), which could give problems if ID or IDREF
  5974.            is present. '''
  5975.         if doc is None:
  5976.             doc__o = None
  5977.         else:
  5978.             doc__o = doc._o
  5979.         if dtd is None:
  5980.             dtd__o = None
  5981.         else:
  5982.             dtd__o = dtd._o
  5983.         ret = libxml2mod.xmlValidateDtd(self._o, doc__o, dtd__o)
  5984.         return ret
  5985.  
  5986.     
  5987.     def validateDtdFinal(self, doc):
  5988.         '''Does the final step for the dtds validation once all the
  5989.           subsets have been parsed  basically it does the following
  5990.           checks described by the XML Rec - check that ENTITY and
  5991.           ENTITIES type attributes default or possible values matches
  5992.           one of the defined entities. - check that NOTATION type
  5993.           attributes default or possible values matches one of the
  5994.            defined notations. '''
  5995.         if doc is None:
  5996.             doc__o = None
  5997.         else:
  5998.             doc__o = doc._o
  5999.         ret = libxml2mod.xmlValidateDtdFinal(self._o, doc__o)
  6000.         return ret
  6001.  
  6002.     
  6003.     def validateElement(self, doc, elem):
  6004.         '''Try to validate the subtree under an element '''
  6005.         if doc is None:
  6006.             doc__o = None
  6007.         else:
  6008.             doc__o = doc._o
  6009.         if elem is None:
  6010.             elem__o = None
  6011.         else:
  6012.             elem__o = elem._o
  6013.         ret = libxml2mod.xmlValidateElement(self._o, doc__o, elem__o)
  6014.         return ret
  6015.  
  6016.     
  6017.     def validateNotationUse(self, doc, notationName):
  6018.         '''Validate that the given name match a notation declaration.
  6019.            - [ VC: Notation Declared ] '''
  6020.         if doc is None:
  6021.             doc__o = None
  6022.         else:
  6023.             doc__o = doc._o
  6024.         ret = libxml2mod.xmlValidateNotationUse(self._o, doc__o, notationName)
  6025.         return ret
  6026.  
  6027.     
  6028.     def validateOneAttribute(self, doc, elem, attr, value):
  6029.         '''Try to validate a single attribute for an element basically
  6030.           it does the following checks as described by the XML-1.0
  6031.           recommendation: - [ VC: Attribute Value Type ] - [ VC:
  6032.           Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
  6033.           Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
  6034.           Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  6035.            uniqueness and matching are done separately '''
  6036.         if doc is None:
  6037.             doc__o = None
  6038.         else:
  6039.             doc__o = doc._o
  6040.         if elem is None:
  6041.             elem__o = None
  6042.         else:
  6043.             elem__o = elem._o
  6044.         if attr is None:
  6045.             attr__o = None
  6046.         else:
  6047.             attr__o = attr._o
  6048.         ret = libxml2mod.xmlValidateOneAttribute(self._o, doc__o, elem__o, attr__o, value)
  6049.         return ret
  6050.  
  6051.     
  6052.     def validateOneElement(self, doc, elem):
  6053.         """Try to validate a single element and it's attributes,
  6054.           basically it does the following checks as described by the
  6055.           XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
  6056.           Required Attribute ] Then call xmlValidateOneAttribute()
  6057.           for each attribute present.  The ID/IDREF checkings are
  6058.            done separately """
  6059.         if doc is None:
  6060.             doc__o = None
  6061.         else:
  6062.             doc__o = doc._o
  6063.         if elem is None:
  6064.             elem__o = None
  6065.         else:
  6066.             elem__o = elem._o
  6067.         ret = libxml2mod.xmlValidateOneElement(self._o, doc__o, elem__o)
  6068.         return ret
  6069.  
  6070.     
  6071.     def validateOneNamespace(self, doc, elem, prefix, ns, value):
  6072.         '''Try to validate a single namespace declaration for an
  6073.           element basically it does the following checks as described
  6074.           by the XML-1.0 recommendation: - [ VC: Attribute Value Type
  6075.           ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
  6076.           [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
  6077.           Entity Name ] - [ VC: Notation Attributes ]  The ID/IDREF
  6078.            uniqueness and matching are done separately '''
  6079.         if doc is None:
  6080.             doc__o = None
  6081.         else:
  6082.             doc__o = doc._o
  6083.         if elem is None:
  6084.             elem__o = None
  6085.         else:
  6086.             elem__o = elem._o
  6087.         if ns is None:
  6088.             ns__o = None
  6089.         else:
  6090.             ns__o = ns._o
  6091.         ret = libxml2mod.xmlValidateOneNamespace(self._o, doc__o, elem__o, prefix, ns__o, value)
  6092.         return ret
  6093.  
  6094.     
  6095.     def validatePopElement(self, doc, elem, qname):
  6096.         '''Pop the element end from the validation stack. '''
  6097.         if doc is None:
  6098.             doc__o = None
  6099.         else:
  6100.             doc__o = doc._o
  6101.         if elem is None:
  6102.             elem__o = None
  6103.         else:
  6104.             elem__o = elem._o
  6105.         ret = libxml2mod.xmlValidatePopElement(self._o, doc__o, elem__o, qname)
  6106.         return ret
  6107.  
  6108.     
  6109.     def validatePushCData(self, data, len):
  6110.         '''check the CData parsed for validation in the current stack '''
  6111.         ret = libxml2mod.xmlValidatePushCData(self._o, data, len)
  6112.         return ret
  6113.  
  6114.     
  6115.     def validatePushElement(self, doc, elem, qname):
  6116.         '''Push a new element start on the validation stack. '''
  6117.         if doc is None:
  6118.             doc__o = None
  6119.         else:
  6120.             doc__o = doc._o
  6121.         if elem is None:
  6122.             elem__o = None
  6123.         else:
  6124.             elem__o = elem._o
  6125.         ret = libxml2mod.xmlValidatePushElement(self._o, doc__o, elem__o, qname)
  6126.         return ret
  6127.  
  6128.     
  6129.     def validateRoot(self, doc):
  6130.         """Try to validate a the root element basically it does the
  6131.           following check as described by the XML-1.0 recommendation:
  6132.           - [ VC: Root Element Type ] it doesn't try to recurse or
  6133.            apply other check to the element """
  6134.         if doc is None:
  6135.             doc__o = None
  6136.         else:
  6137.             doc__o = doc._o
  6138.         ret = libxml2mod.xmlValidateRoot(self._o, doc__o)
  6139.         return ret
  6140.  
  6141.  
  6142.  
  6143. class xmlElement(xmlNode):
  6144.     
  6145.     def __init__(self, _obj = None):
  6146.         if type(_obj).__name__ != 'PyCObject':
  6147.             raise TypeError, 'xmlElement needs a PyCObject argument'
  6148.         type(_obj).__name__ != 'PyCObject'
  6149.         self._o = _obj
  6150.         xmlNode.__init__(self, _obj = _obj)
  6151.  
  6152.     
  6153.     def __repr__(self):
  6154.         return '<xmlElement (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  6155.  
  6156.  
  6157.  
  6158. class xmlAttr(xmlNode):
  6159.     
  6160.     def __init__(self, _obj = None):
  6161.         if type(_obj).__name__ != 'PyCObject':
  6162.             raise TypeError, 'xmlAttr needs a PyCObject argument'
  6163.         type(_obj).__name__ != 'PyCObject'
  6164.         self._o = _obj
  6165.         xmlNode.__init__(self, _obj = _obj)
  6166.  
  6167.     
  6168.     def __repr__(self):
  6169.         return '<xmlAttr (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  6170.  
  6171.     
  6172.     def debugDumpAttr(self, output, depth):
  6173.         '''Dumps debug information for the attribute '''
  6174.         libxml2mod.xmlDebugDumpAttr(output, self._o, depth)
  6175.  
  6176.     
  6177.     def debugDumpAttrList(self, output, depth):
  6178.         '''Dumps debug information for the attribute list '''
  6179.         libxml2mod.xmlDebugDumpAttrList(output, self._o, depth)
  6180.  
  6181.     
  6182.     def copyProp(self, target):
  6183.         '''Do a copy of the attribute. '''
  6184.         if target is None:
  6185.             target__o = None
  6186.         else:
  6187.             target__o = target._o
  6188.         ret = libxml2mod.xmlCopyProp(target__o, self._o)
  6189.         if ret is None:
  6190.             raise treeError('xmlCopyProp() failed')
  6191.         ret is None
  6192.         _xmlAttr__tmp = xmlAttr(_obj = ret)
  6193.         return _xmlAttr__tmp
  6194.  
  6195.     
  6196.     def copyPropList(self, target):
  6197.         '''Do a copy of an attribute list. '''
  6198.         if target is None:
  6199.             target__o = None
  6200.         else:
  6201.             target__o = target._o
  6202.         ret = libxml2mod.xmlCopyPropList(target__o, self._o)
  6203.         if ret is None:
  6204.             raise treeError('xmlCopyPropList() failed')
  6205.         ret is None
  6206.         _xmlAttr__tmp = xmlAttr(_obj = ret)
  6207.         return _xmlAttr__tmp
  6208.  
  6209.     
  6210.     def freeProp(self):
  6211.         '''Free one attribute, all the content is freed too '''
  6212.         libxml2mod.xmlFreeProp(self._o)
  6213.  
  6214.     
  6215.     def freePropList(self):
  6216.         '''Free a property and all its siblings, all the children are
  6217.            freed too. '''
  6218.         libxml2mod.xmlFreePropList(self._o)
  6219.  
  6220.     
  6221.     def removeProp(self):
  6222.         """Unlink and free one attribute, all the content is freed too
  6223.            Note this doesn't work for namespace definition attributes """
  6224.         ret = libxml2mod.xmlRemoveProp(self._o)
  6225.         return ret
  6226.  
  6227.     
  6228.     def removeID(self, doc):
  6229.         '''Remove the given attribute from the ID table maintained
  6230.            internally. '''
  6231.         if doc is None:
  6232.             doc__o = None
  6233.         else:
  6234.             doc__o = doc._o
  6235.         ret = libxml2mod.xmlRemoveID(doc__o, self._o)
  6236.         return ret
  6237.  
  6238.     
  6239.     def removeRef(self, doc):
  6240.         '''Remove the given attribute from the Ref table maintained
  6241.            internally. '''
  6242.         if doc is None:
  6243.             doc__o = None
  6244.         else:
  6245.             doc__o = doc._o
  6246.         ret = libxml2mod.xmlRemoveRef(doc__o, self._o)
  6247.         return ret
  6248.  
  6249.  
  6250.  
  6251. class xmlTextReader(xmlTextReaderCore):
  6252.     
  6253.     def __init__(self, _obj = None):
  6254.         self.input = None
  6255.         self._o = _obj
  6256.         xmlTextReaderCore.__init__(self, _obj = _obj)
  6257.  
  6258.     
  6259.     def __del__(self):
  6260.         if self._o != None:
  6261.             libxml2mod.xmlFreeTextReader(self._o)
  6262.         
  6263.         self._o = None
  6264.  
  6265.     
  6266.     def AttributeCount(self):
  6267.         '''Provides the number of attributes of the current node '''
  6268.         ret = libxml2mod.xmlTextReaderAttributeCount(self._o)
  6269.         return ret
  6270.  
  6271.     
  6272.     def BaseUri(self):
  6273.         '''The base URI of the node. '''
  6274.         ret = libxml2mod.xmlTextReaderConstBaseUri(self._o)
  6275.         return ret
  6276.  
  6277.     
  6278.     def ByteConsumed(self):
  6279.         '''This function provides the current index of the parser used
  6280.           by the reader, relative to the start of the current entity.
  6281.           This function actually just wraps a call to
  6282.           xmlBytesConsumed() for the parser context associated with
  6283.            the reader. See xmlBytesConsumed() for more information. '''
  6284.         ret = libxml2mod.xmlTextReaderByteConsumed(self._o)
  6285.         return ret
  6286.  
  6287.     
  6288.     def Close(self):
  6289.         '''This method releases any resources allocated by the current
  6290.           instance changes the state to Closed and close any
  6291.            underlying input. '''
  6292.         ret = libxml2mod.xmlTextReaderClose(self._o)
  6293.         return ret
  6294.  
  6295.     
  6296.     def CurrentDoc(self):
  6297.         '''Hacking interface allowing to get the xmlDocPtr
  6298.           correponding to the current document being accessed by the
  6299.           xmlTextReader. NOTE: as a result of this call, the reader
  6300.           will not destroy the associated XML document and calling
  6301.           xmlFreeDoc() on the result is needed once the reader
  6302.            parsing has finished. '''
  6303.         ret = libxml2mod.xmlTextReaderCurrentDoc(self._o)
  6304.         if ret is None:
  6305.             raise treeError('xmlTextReaderCurrentDoc() failed')
  6306.         ret is None
  6307.         _xmlTextReader__tmp = xmlDoc(_obj = ret)
  6308.         return _xmlTextReader__tmp
  6309.  
  6310.     
  6311.     def CurrentNode(self):
  6312.         '''Hacking interface allowing to get the xmlNodePtr
  6313.           correponding to the current node being accessed by the
  6314.           xmlTextReader. This is dangerous because the underlying
  6315.            node may be destroyed on the next Reads. '''
  6316.         ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
  6317.         if ret is None:
  6318.             raise treeError('xmlTextReaderCurrentNode() failed')
  6319.         ret is None
  6320.         _xmlTextReader__tmp = xmlNode(_obj = ret)
  6321.         return _xmlTextReader__tmp
  6322.  
  6323.     
  6324.     def Depth(self):
  6325.         '''The depth of the node in the tree. '''
  6326.         ret = libxml2mod.xmlTextReaderDepth(self._o)
  6327.         return ret
  6328.  
  6329.     
  6330.     def Encoding(self):
  6331.         '''Determine the encoding of the document being read. '''
  6332.         ret = libxml2mod.xmlTextReaderConstEncoding(self._o)
  6333.         return ret
  6334.  
  6335.     
  6336.     def Expand(self):
  6337.         '''Reads the contents of the current node and the full
  6338.           subtree. It then makes the subtree available until the next
  6339.            xmlTextReaderRead() call '''
  6340.         ret = libxml2mod.xmlTextReaderExpand(self._o)
  6341.         if ret is None:
  6342.             raise treeError('xmlTextReaderExpand() failed')
  6343.         ret is None
  6344.         _xmlTextReader__tmp = xmlNode(_obj = ret)
  6345.         return _xmlTextReader__tmp
  6346.  
  6347.     
  6348.     def GetAttribute(self, name):
  6349.         '''Provides the value of the attribute with the specified
  6350.            qualified name. '''
  6351.         ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
  6352.         return ret
  6353.  
  6354.     
  6355.     def GetAttributeNo(self, no):
  6356.         '''Provides the value of the attribute with the specified
  6357.            index relative to the containing element. '''
  6358.         ret = libxml2mod.xmlTextReaderGetAttributeNo(self._o, no)
  6359.         return ret
  6360.  
  6361.     
  6362.     def GetAttributeNs(self, localName, namespaceURI):
  6363.         '''Provides the value of the specified attribute '''
  6364.         ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI)
  6365.         return ret
  6366.  
  6367.     
  6368.     def GetParserColumnNumber(self):
  6369.         '''Provide the column number of the current parsing point. '''
  6370.         ret = libxml2mod.xmlTextReaderGetParserColumnNumber(self._o)
  6371.         return ret
  6372.  
  6373.     
  6374.     def GetParserLineNumber(self):
  6375.         '''Provide the line number of the current parsing point. '''
  6376.         ret = libxml2mod.xmlTextReaderGetParserLineNumber(self._o)
  6377.         return ret
  6378.  
  6379.     
  6380.     def GetParserProp(self, prop):
  6381.         '''Read the parser internal property. '''
  6382.         ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop)
  6383.         return ret
  6384.  
  6385.     
  6386.     def GetRemainder(self):
  6387.         """Method to get the remainder of the buffered XML. this
  6388.           method stops the parser, set its state to End Of File and
  6389.           return the input stream with what is left that the parser
  6390.           did not use.  The implementation is not good, the parser
  6391.           certainly procgressed past what's left in reader->input,
  6392.           and there is an allocation problem. Best would be to
  6393.            rewrite it differently. """
  6394.         ret = libxml2mod.xmlTextReaderGetRemainder(self._o)
  6395.         if ret is None:
  6396.             raise treeError('xmlTextReaderGetRemainder() failed')
  6397.         ret is None
  6398.         _xmlTextReader__tmp = inputBuffer(_obj = ret)
  6399.         return _xmlTextReader__tmp
  6400.  
  6401.     
  6402.     def HasAttributes(self):
  6403.         '''Whether the node has attributes. '''
  6404.         ret = libxml2mod.xmlTextReaderHasAttributes(self._o)
  6405.         return ret
  6406.  
  6407.     
  6408.     def HasValue(self):
  6409.         '''Whether the node can have a text value. '''
  6410.         ret = libxml2mod.xmlTextReaderHasValue(self._o)
  6411.         return ret
  6412.  
  6413.     
  6414.     def IsDefault(self):
  6415.         '''Whether an Attribute  node was generated from the default
  6416.            value defined in the DTD or schema. '''
  6417.         ret = libxml2mod.xmlTextReaderIsDefault(self._o)
  6418.         return ret
  6419.  
  6420.     
  6421.     def IsEmptyElement(self):
  6422.         '''Check if the current node is empty '''
  6423.         ret = libxml2mod.xmlTextReaderIsEmptyElement(self._o)
  6424.         return ret
  6425.  
  6426.     
  6427.     def IsNamespaceDecl(self):
  6428.         '''Determine whether the current node is a namespace
  6429.            declaration rather than a regular attribute. '''
  6430.         ret = libxml2mod.xmlTextReaderIsNamespaceDecl(self._o)
  6431.         return ret
  6432.  
  6433.     
  6434.     def IsValid(self):
  6435.         '''Retrieve the validity status from the parser context '''
  6436.         ret = libxml2mod.xmlTextReaderIsValid(self._o)
  6437.         return ret
  6438.  
  6439.     
  6440.     def LocalName(self):
  6441.         '''The local name of the node. '''
  6442.         ret = libxml2mod.xmlTextReaderConstLocalName(self._o)
  6443.         return ret
  6444.  
  6445.     
  6446.     def LookupNamespace(self, prefix):
  6447.         '''Resolves a namespace prefix in the scope of the current
  6448.            element. '''
  6449.         ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
  6450.         return ret
  6451.  
  6452.     
  6453.     def MoveToAttribute(self, name):
  6454.         '''Moves the position of the current instance to the attribute
  6455.            with the specified qualified name. '''
  6456.         ret = libxml2mod.xmlTextReaderMoveToAttribute(self._o, name)
  6457.         return ret
  6458.  
  6459.     
  6460.     def MoveToAttributeNo(self, no):
  6461.         '''Moves the position of the current instance to the attribute
  6462.           with the specified index relative to the containing element. '''
  6463.         ret = libxml2mod.xmlTextReaderMoveToAttributeNo(self._o, no)
  6464.         return ret
  6465.  
  6466.     
  6467.     def MoveToAttributeNs(self, localName, namespaceURI):
  6468.         '''Moves the position of the current instance to the attribute
  6469.            with the specified local name and namespace URI. '''
  6470.         ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
  6471.         return ret
  6472.  
  6473.     
  6474.     def MoveToElement(self):
  6475.         '''Moves the position of the current instance to the node that
  6476.            contains the current Attribute  node. '''
  6477.         ret = libxml2mod.xmlTextReaderMoveToElement(self._o)
  6478.         return ret
  6479.  
  6480.     
  6481.     def MoveToFirstAttribute(self):
  6482.         '''Moves the position of the current instance to the first
  6483.            attribute associated with the current node. '''
  6484.         ret = libxml2mod.xmlTextReaderMoveToFirstAttribute(self._o)
  6485.         return ret
  6486.  
  6487.     
  6488.     def MoveToNextAttribute(self):
  6489.         '''Moves the position of the current instance to the next
  6490.            attribute associated with the current node. '''
  6491.         ret = libxml2mod.xmlTextReaderMoveToNextAttribute(self._o)
  6492.         return ret
  6493.  
  6494.     
  6495.     def Name(self):
  6496.         '''The qualified name of the node, equal to Prefix :LocalName. '''
  6497.         ret = libxml2mod.xmlTextReaderConstName(self._o)
  6498.         return ret
  6499.  
  6500.     
  6501.     def NamespaceUri(self):
  6502.         '''The URI defining the namespace associated with the node. '''
  6503.         ret = libxml2mod.xmlTextReaderConstNamespaceUri(self._o)
  6504.         return ret
  6505.  
  6506.     
  6507.     def NewDoc(self, cur, URL, encoding, options):
  6508.         '''Setup an xmltextReader to parse an XML in-memory document.
  6509.           The parsing flags @options are a combination of
  6510.           xmlParserOption. This reuses the existing @reader
  6511.            xmlTextReader. '''
  6512.         ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options)
  6513.         return ret
  6514.  
  6515.     
  6516.     def NewFd(self, fd, URL, encoding, options):
  6517.         '''Setup an xmltextReader to parse an XML from a file
  6518.           descriptor. NOTE that the file descriptor will not be
  6519.           closed when the reader is closed or reset. The parsing
  6520.           flags @options are a combination of xmlParserOption. This
  6521.            reuses the existing @reader xmlTextReader. '''
  6522.         ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options)
  6523.         return ret
  6524.  
  6525.     
  6526.     def NewFile(self, filename, encoding, options):
  6527.         '''parse an XML file from the filesystem or the network. The
  6528.           parsing flags @options are a combination of
  6529.           xmlParserOption. This reuses the existing @reader
  6530.            xmlTextReader. '''
  6531.         ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options)
  6532.         return ret
  6533.  
  6534.     
  6535.     def NewMemory(self, buffer, size, URL, encoding, options):
  6536.         '''Setup an xmltextReader to parse an XML in-memory document.
  6537.           The parsing flags @options are a combination of
  6538.           xmlParserOption. This reuses the existing @reader
  6539.            xmlTextReader. '''
  6540.         ret = libxml2mod.xmlReaderNewMemory(self._o, buffer, size, URL, encoding, options)
  6541.         return ret
  6542.  
  6543.     
  6544.     def NewWalker(self, doc):
  6545.         '''Setup an xmltextReader to parse a preparsed XML document.
  6546.            This reuses the existing @reader xmlTextReader. '''
  6547.         if doc is None:
  6548.             doc__o = None
  6549.         else:
  6550.             doc__o = doc._o
  6551.         ret = libxml2mod.xmlReaderNewWalker(self._o, doc__o)
  6552.         return ret
  6553.  
  6554.     
  6555.     def Next(self):
  6556.         '''Skip to the node following the current one in document
  6557.            order while avoiding the subtree if any. '''
  6558.         ret = libxml2mod.xmlTextReaderNext(self._o)
  6559.         return ret
  6560.  
  6561.     
  6562.     def NextSibling(self):
  6563.         '''Skip to the node following the current one in document
  6564.           order while avoiding the subtree if any. Currently
  6565.            implemented only for Readers built on a document '''
  6566.         ret = libxml2mod.xmlTextReaderNextSibling(self._o)
  6567.         return ret
  6568.  
  6569.     
  6570.     def NodeType(self):
  6571.         '''Get the node type of the current node Reference:
  6572.           http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
  6573.           lNodeType.html '''
  6574.         ret = libxml2mod.xmlTextReaderNodeType(self._o)
  6575.         return ret
  6576.  
  6577.     
  6578.     def Normalization(self):
  6579.         '''The value indicating whether to normalize white space and
  6580.           attribute values. Since attribute value and end of line
  6581.           normalizations are a MUST in the XML specification only the
  6582.           value true is accepted. The broken bahaviour of accepting
  6583.           out of range character entities like � is of course not
  6584.            supported either. '''
  6585.         ret = libxml2mod.xmlTextReaderNormalization(self._o)
  6586.         return ret
  6587.  
  6588.     
  6589.     def Prefix(self):
  6590.         '''A shorthand reference to the namespace associated with the
  6591.            node. '''
  6592.         ret = libxml2mod.xmlTextReaderConstPrefix(self._o)
  6593.         return ret
  6594.  
  6595.     
  6596.     def Preserve(self):
  6597.         '''This tells the XML Reader to preserve the current node. The
  6598.           caller must also use xmlTextReaderCurrentDoc() to keep an
  6599.            handle on the resulting document once parsing has finished '''
  6600.         ret = libxml2mod.xmlTextReaderPreserve(self._o)
  6601.         if ret is None:
  6602.             raise treeError('xmlTextReaderPreserve() failed')
  6603.         ret is None
  6604.         _xmlTextReader__tmp = xmlNode(_obj = ret)
  6605.         return _xmlTextReader__tmp
  6606.  
  6607.     
  6608.     def QuoteChar(self):
  6609.         '''The quotation mark character used to enclose the value of
  6610.            an attribute. '''
  6611.         ret = libxml2mod.xmlTextReaderQuoteChar(self._o)
  6612.         return ret
  6613.  
  6614.     
  6615.     def Read(self):
  6616.         '''Moves the position of the current instance to the next node
  6617.            in the stream, exposing its properties. '''
  6618.         ret = libxml2mod.xmlTextReaderRead(self._o)
  6619.         return ret
  6620.  
  6621.     
  6622.     def ReadAttributeValue(self):
  6623.         '''Parses an attribute value into one or more Text and
  6624.            EntityReference nodes. '''
  6625.         ret = libxml2mod.xmlTextReaderReadAttributeValue(self._o)
  6626.         return ret
  6627.  
  6628.     
  6629.     def ReadInnerXml(self):
  6630.         '''Reads the contents of the current node, including child
  6631.            nodes and markup. '''
  6632.         ret = libxml2mod.xmlTextReaderReadInnerXml(self._o)
  6633.         return ret
  6634.  
  6635.     
  6636.     def ReadOuterXml(self):
  6637.         '''Reads the contents of the current node, including child
  6638.            nodes and markup. '''
  6639.         ret = libxml2mod.xmlTextReaderReadOuterXml(self._o)
  6640.         return ret
  6641.  
  6642.     
  6643.     def ReadState(self):
  6644.         '''Gets the read state of the reader. '''
  6645.         ret = libxml2mod.xmlTextReaderReadState(self._o)
  6646.         return ret
  6647.  
  6648.     
  6649.     def ReadString(self):
  6650.         '''Reads the contents of an element or a text node as a string. '''
  6651.         ret = libxml2mod.xmlTextReaderReadString(self._o)
  6652.         return ret
  6653.  
  6654.     
  6655.     def RelaxNGSetSchema(self, schema):
  6656.         '''Use RelaxNG to validate the document as it is processed.
  6657.           Activation is only possible before the first Read(). if
  6658.           @schema is None, then RelaxNG validation is desactivated. @
  6659.           The @schema should not be freed until the reader is
  6660.            deallocated or its use has been deactivated. '''
  6661.         if schema is None:
  6662.             schema__o = None
  6663.         else:
  6664.             schema__o = schema._o
  6665.         ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(self._o, schema__o)
  6666.         return ret
  6667.  
  6668.     
  6669.     def RelaxNGValidate(self, rng):
  6670.         '''Use RelaxNG to validate the document as it is processed.
  6671.           Activation is only possible before the first Read(). if
  6672.            @rng is None, then RelaxNG validation is deactivated. '''
  6673.         ret = libxml2mod.xmlTextReaderRelaxNGValidate(self._o, rng)
  6674.         return ret
  6675.  
  6676.     
  6677.     def SchemaValidate(self, xsd):
  6678.         '''Use W3C XSD schema to validate the document as it is
  6679.           processed. Activation is only possible before the first
  6680.           Read(). If @xsd is None, then XML Schema validation is
  6681.            deactivated. '''
  6682.         ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd)
  6683.         return ret
  6684.  
  6685.     
  6686.     def SchemaValidateCtxt(self, ctxt, options):
  6687.         '''Use W3C XSD schema context to validate the document as it
  6688.           is processed. Activation is only possible before the first
  6689.           Read(). If @ctxt is None, then XML Schema validation is
  6690.            deactivated. '''
  6691.         if ctxt is None:
  6692.             ctxt__o = None
  6693.         else:
  6694.             ctxt__o = ctxt._o
  6695.         ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(self._o, ctxt__o, options)
  6696.         return ret
  6697.  
  6698.     
  6699.     def SetParserProp(self, prop, value):
  6700.         '''Change the parser processing behaviour by changing some of
  6701.           its internal properties. Note that some properties can only
  6702.            be changed before any read has been done. '''
  6703.         ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value)
  6704.         return ret
  6705.  
  6706.     
  6707.     def SetSchema(self, schema):
  6708.         '''Use XSD Schema to validate the document as it is processed.
  6709.           Activation is only possible before the first Read(). if
  6710.           @schema is None, then Schema validation is desactivated. @
  6711.           The @schema should not be freed until the reader is
  6712.            deallocated or its use has been deactivated. '''
  6713.         if schema is None:
  6714.             schema__o = None
  6715.         else:
  6716.             schema__o = schema._o
  6717.         ret = libxml2mod.xmlTextReaderSetSchema(self._o, schema__o)
  6718.         return ret
  6719.  
  6720.     
  6721.     def Setup(self, input, URL, encoding, options):
  6722.         '''Setup an XML reader with new options '''
  6723.         if input is None:
  6724.             input__o = None
  6725.         else:
  6726.             input__o = input._o
  6727.         ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options)
  6728.         return ret
  6729.  
  6730.     
  6731.     def Standalone(self):
  6732.         '''Determine the standalone status of the document being read. '''
  6733.         ret = libxml2mod.xmlTextReaderStandalone(self._o)
  6734.         return ret
  6735.  
  6736.     
  6737.     def String(self, str):
  6738.         '''Get an interned string from the reader, allows for example
  6739.            to speedup string name comparisons '''
  6740.         ret = libxml2mod.xmlTextReaderConstString(self._o, str)
  6741.         return ret
  6742.  
  6743.     
  6744.     def Value(self):
  6745.         '''Provides the text value of the node if present '''
  6746.         ret = libxml2mod.xmlTextReaderConstValue(self._o)
  6747.         return ret
  6748.  
  6749.     
  6750.     def XmlLang(self):
  6751.         '''The xml:lang scope within which the node resides. '''
  6752.         ret = libxml2mod.xmlTextReaderConstXmlLang(self._o)
  6753.         return ret
  6754.  
  6755.     
  6756.     def XmlVersion(self):
  6757.         '''Determine the XML version of the document being read. '''
  6758.         ret = libxml2mod.xmlTextReaderConstXmlVersion(self._o)
  6759.         return ret
  6760.  
  6761.  
  6762.  
  6763. class xmlReg:
  6764.     
  6765.     def __init__(self, _obj = None):
  6766.         if _obj != None:
  6767.             self._o = _obj
  6768.             return None
  6769.         self._o = None
  6770.  
  6771.     
  6772.     def __del__(self):
  6773.         if self._o != None:
  6774.             libxml2mod.xmlRegFreeRegexp(self._o)
  6775.         
  6776.         self._o = None
  6777.  
  6778.     
  6779.     def regexpExec(self, content):
  6780.         '''Check if the regular expression generates the value '''
  6781.         ret = libxml2mod.xmlRegexpExec(self._o, content)
  6782.         return ret
  6783.  
  6784.     
  6785.     def regexpIsDeterminist(self):
  6786.         '''Check if the regular expression is determinist '''
  6787.         ret = libxml2mod.xmlRegexpIsDeterminist(self._o)
  6788.         return ret
  6789.  
  6790.     
  6791.     def regexpPrint(self, output):
  6792.         '''Print the content of the compiled regular expression '''
  6793.         libxml2mod.xmlRegexpPrint(output, self._o)
  6794.  
  6795.  
  6796.  
  6797. class catalog:
  6798.     
  6799.     def __init__(self, _obj = None):
  6800.         if _obj != None:
  6801.             self._o = _obj
  6802.             return None
  6803.         self._o = None
  6804.  
  6805.     
  6806.     def __del__(self):
  6807.         if self._o != None:
  6808.             libxml2mod.xmlFreeCatalog(self._o)
  6809.         
  6810.         self._o = None
  6811.  
  6812.     
  6813.     def add(self, type, orig, replace):
  6814.         '''Add an entry in the catalog, it may overwrite existing but
  6815.            different entries. '''
  6816.         ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace)
  6817.         return ret
  6818.  
  6819.     
  6820.     def catalogIsEmpty(self):
  6821.         '''Check is a catalog is empty '''
  6822.         ret = libxml2mod.xmlCatalogIsEmpty(self._o)
  6823.         return ret
  6824.  
  6825.     
  6826.     def convertSGMLCatalog(self):
  6827.         '''Convert all the SGML catalog entries as XML ones '''
  6828.         ret = libxml2mod.xmlConvertSGMLCatalog(self._o)
  6829.         return ret
  6830.  
  6831.     
  6832.     def dump(self, out):
  6833.         '''Dump the given catalog to the given file. '''
  6834.         libxml2mod.xmlACatalogDump(self._o, out)
  6835.  
  6836.     
  6837.     def remove(self, value):
  6838.         '''Remove an entry from the catalog '''
  6839.         ret = libxml2mod.xmlACatalogRemove(self._o, value)
  6840.         return ret
  6841.  
  6842.     
  6843.     def resolve(self, pubID, sysID):
  6844.         '''Do a complete resolution lookup of an External Identifier '''
  6845.         ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID)
  6846.         return ret
  6847.  
  6848.     
  6849.     def resolvePublic(self, pubID):
  6850.         '''Try to lookup the catalog local reference associated to a
  6851.            public ID in that catalog '''
  6852.         ret = libxml2mod.xmlACatalogResolvePublic(self._o, pubID)
  6853.         return ret
  6854.  
  6855.     
  6856.     def resolveSystem(self, sysID):
  6857.         '''Try to lookup the catalog resource for a system ID '''
  6858.         ret = libxml2mod.xmlACatalogResolveSystem(self._o, sysID)
  6859.         return ret
  6860.  
  6861.     
  6862.     def resolveURI(self, URI):
  6863.         '''Do a complete resolution lookup of an URI '''
  6864.         ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
  6865.         return ret
  6866.  
  6867.  
  6868.  
  6869. class xmlEntity(xmlNode):
  6870.     
  6871.     def __init__(self, _obj = None):
  6872.         if type(_obj).__name__ != 'PyCObject':
  6873.             raise TypeError, 'xmlEntity needs a PyCObject argument'
  6874.         type(_obj).__name__ != 'PyCObject'
  6875.         self._o = _obj
  6876.         xmlNode.__init__(self, _obj = _obj)
  6877.  
  6878.     
  6879.     def __repr__(self):
  6880.         return '<xmlEntity (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  6881.  
  6882.     
  6883.     def handleEntity(self, ctxt):
  6884.         '''Default handling of defined entities, when should we define
  6885.           a new input stream ? When do we just handle that as a set
  6886.            of chars ?  OBSOLETE: to be removed at some point. '''
  6887.         if ctxt is None:
  6888.             ctxt__o = None
  6889.         else:
  6890.             ctxt__o = ctxt._o
  6891.         libxml2mod.xmlHandleEntity(ctxt__o, self._o)
  6892.  
  6893.  
  6894.  
  6895. class relaxNgSchema:
  6896.     
  6897.     def __init__(self, _obj = None):
  6898.         if _obj != None:
  6899.             self._o = _obj
  6900.             return None
  6901.         self._o = None
  6902.  
  6903.     
  6904.     def __del__(self):
  6905.         if self._o != None:
  6906.             libxml2mod.xmlRelaxNGFree(self._o)
  6907.         
  6908.         self._o = None
  6909.  
  6910.     
  6911.     def relaxNGDump(self, output):
  6912.         '''Dump a RelaxNG structure back '''
  6913.         libxml2mod.xmlRelaxNGDump(output, self._o)
  6914.  
  6915.     
  6916.     def relaxNGDumpTree(self, output):
  6917.         '''Dump the transformed RelaxNG tree. '''
  6918.         libxml2mod.xmlRelaxNGDumpTree(output, self._o)
  6919.  
  6920.     
  6921.     def relaxNGNewValidCtxt(self):
  6922.         '''Create an XML RelaxNGs validation context based on the
  6923.            given schema '''
  6924.         ret = libxml2mod.xmlRelaxNGNewValidCtxt(self._o)
  6925.         if ret is None:
  6926.             raise treeError('xmlRelaxNGNewValidCtxt() failed')
  6927.         ret is None
  6928.         _relaxNgSchema__tmp = relaxNgValidCtxt(_obj = ret)
  6929.         _relaxNgSchema__tmp.schema = self
  6930.         return _relaxNgSchema__tmp
  6931.  
  6932.     
  6933.     def RelaxNGSetSchema(self, reader):
  6934.         '''Use RelaxNG to validate the document as it is processed.
  6935.           Activation is only possible before the first Read(). if
  6936.           @schema is None, then RelaxNG validation is desactivated. @
  6937.           The @schema should not be freed until the reader is
  6938.            deallocated or its use has been deactivated. '''
  6939.         if reader is None:
  6940.             reader__o = None
  6941.         else:
  6942.             reader__o = reader._o
  6943.         ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(reader__o, self._o)
  6944.         return ret
  6945.  
  6946.  
  6947.  
  6948. class Schema:
  6949.     
  6950.     def __init__(self, _obj = None):
  6951.         if _obj != None:
  6952.             self._o = _obj
  6953.             return None
  6954.         self._o = None
  6955.  
  6956.     
  6957.     def __del__(self):
  6958.         if self._o != None:
  6959.             libxml2mod.xmlSchemaFree(self._o)
  6960.         
  6961.         self._o = None
  6962.  
  6963.     
  6964.     def SetSchema(self, reader):
  6965.         '''Use XSD Schema to validate the document as it is processed.
  6966.           Activation is only possible before the first Read(). if
  6967.           @schema is None, then Schema validation is desactivated. @
  6968.           The @schema should not be freed until the reader is
  6969.            deallocated or its use has been deactivated. '''
  6970.         if reader is None:
  6971.             reader__o = None
  6972.         else:
  6973.             reader__o = reader._o
  6974.         ret = libxml2mod.xmlTextReaderSetSchema(reader__o, self._o)
  6975.         return ret
  6976.  
  6977.     
  6978.     def schemaDump(self, output):
  6979.         '''Dump a Schema structure. '''
  6980.         libxml2mod.xmlSchemaDump(output, self._o)
  6981.  
  6982.     
  6983.     def schemaNewValidCtxt(self):
  6984.         ret = libxml2mod.xmlSchemaNewValidCtxt(self._o)
  6985.         if ret is None:
  6986.             raise treeError('xmlSchemaNewValidCtxt() failed')
  6987.         ret is None
  6988.         _Schema__tmp = SchemaValidCtxt(_obj = ret)
  6989.         _Schema__tmp.schema = self
  6990.         return _Schema__tmp
  6991.  
  6992.  
  6993.  
  6994. class Error:
  6995.     
  6996.     def __init__(self, _obj = None):
  6997.         if _obj != None:
  6998.             self._o = _obj
  6999.             return None
  7000.         self._o = None
  7001.  
  7002.     
  7003.     def code(self):
  7004.         '''The error code, e.g. an xmlParserError '''
  7005.         ret = libxml2mod.xmlErrorGetCode(self._o)
  7006.         return ret
  7007.  
  7008.     
  7009.     def domain(self):
  7010.         '''What part of the library raised this error '''
  7011.         ret = libxml2mod.xmlErrorGetDomain(self._o)
  7012.         return ret
  7013.  
  7014.     
  7015.     def file(self):
  7016.         '''the filename '''
  7017.         ret = libxml2mod.xmlErrorGetFile(self._o)
  7018.         return ret
  7019.  
  7020.     
  7021.     def level(self):
  7022.         '''how consequent is the error '''
  7023.         ret = libxml2mod.xmlErrorGetLevel(self._o)
  7024.         return ret
  7025.  
  7026.     
  7027.     def line(self):
  7028.         '''the line number if available '''
  7029.         ret = libxml2mod.xmlErrorGetLine(self._o)
  7030.         return ret
  7031.  
  7032.     
  7033.     def message(self):
  7034.         '''human-readable informative error message '''
  7035.         ret = libxml2mod.xmlErrorGetMessage(self._o)
  7036.         return ret
  7037.  
  7038.     
  7039.     def copyError(self, to):
  7040.         '''Save the original error to the new place. '''
  7041.         if to is None:
  7042.             to__o = None
  7043.         else:
  7044.             to__o = to._o
  7045.         ret = libxml2mod.xmlCopyError(self._o, to__o)
  7046.         return ret
  7047.  
  7048.     
  7049.     def resetError(self):
  7050.         '''Cleanup the error. '''
  7051.         libxml2mod.xmlResetError(self._o)
  7052.  
  7053.  
  7054.  
  7055. class relaxNgValidCtxt(relaxNgValidCtxtCore):
  7056.     
  7057.     def __init__(self, _obj = None):
  7058.         self.schema = None
  7059.         self._o = _obj
  7060.         relaxNgValidCtxtCore.__init__(self, _obj = _obj)
  7061.  
  7062.     
  7063.     def __del__(self):
  7064.         if self._o != None:
  7065.             libxml2mod.xmlRelaxNGFreeValidCtxt(self._o)
  7066.         
  7067.         self._o = None
  7068.  
  7069.     
  7070.     def relaxNGValidateDoc(self, doc):
  7071.         '''Validate a document tree in memory. '''
  7072.         if doc is None:
  7073.             doc__o = None
  7074.         else:
  7075.             doc__o = doc._o
  7076.         ret = libxml2mod.xmlRelaxNGValidateDoc(self._o, doc__o)
  7077.         return ret
  7078.  
  7079.     
  7080.     def relaxNGValidateFullElement(self, doc, elem):
  7081.         '''Validate a full subtree when
  7082.           xmlRelaxNGValidatePushElement() returned 0 and the content
  7083.            of the node has been expanded. '''
  7084.         if doc is None:
  7085.             doc__o = None
  7086.         else:
  7087.             doc__o = doc._o
  7088.         if elem is None:
  7089.             elem__o = None
  7090.         else:
  7091.             elem__o = elem._o
  7092.         ret = libxml2mod.xmlRelaxNGValidateFullElement(self._o, doc__o, elem__o)
  7093.         return ret
  7094.  
  7095.     
  7096.     def relaxNGValidatePopElement(self, doc, elem):
  7097.         '''Pop the element end from the RelaxNG validation stack. '''
  7098.         if doc is None:
  7099.             doc__o = None
  7100.         else:
  7101.             doc__o = doc._o
  7102.         if elem is None:
  7103.             elem__o = None
  7104.         else:
  7105.             elem__o = elem._o
  7106.         ret = libxml2mod.xmlRelaxNGValidatePopElement(self._o, doc__o, elem__o)
  7107.         return ret
  7108.  
  7109.     
  7110.     def relaxNGValidatePushCData(self, data, len):
  7111.         '''check the CData parsed for validation in the current stack '''
  7112.         ret = libxml2mod.xmlRelaxNGValidatePushCData(self._o, data, len)
  7113.         return ret
  7114.  
  7115.     
  7116.     def relaxNGValidatePushElement(self, doc, elem):
  7117.         '''Push a new element start on the RelaxNG validation stack. '''
  7118.         if doc is None:
  7119.             doc__o = None
  7120.         else:
  7121.             doc__o = doc._o
  7122.         if elem is None:
  7123.             elem__o = None
  7124.         else:
  7125.             elem__o = elem._o
  7126.         ret = libxml2mod.xmlRelaxNGValidatePushElement(self._o, doc__o, elem__o)
  7127.         return ret
  7128.  
  7129.  
  7130.  
  7131. class xpathParserContext:
  7132.     
  7133.     def __init__(self, _obj = None):
  7134.         if _obj != None:
  7135.             self._o = _obj
  7136.             return None
  7137.         self._o = None
  7138.  
  7139.     
  7140.     def context(self):
  7141.         '''Get the xpathContext from an xpathParserContext '''
  7142.         ret = libxml2mod.xmlXPathParserGetContext(self._o)
  7143.         if ret is None:
  7144.             raise xpathError('xmlXPathParserGetContext() failed')
  7145.         ret is None
  7146.         _xpathParserContext__tmp = xpathContext(_obj = ret)
  7147.         return _xpathParserContext__tmp
  7148.  
  7149.     
  7150.     def xpathAddValues(self):
  7151.         '''Implement the add operation on XPath objects: The numeric
  7152.           operators convert their operands to numbers as if by
  7153.            calling the number function. '''
  7154.         libxml2mod.xmlXPathAddValues(self._o)
  7155.  
  7156.     
  7157.     def xpathBooleanFunction(self, nargs):
  7158.         '''Implement the boolean() XPath function boolean
  7159.           boolean(object) The boolean function converts its argument
  7160.           to a boolean as follows: - a number is true if and only if
  7161.           it is neither positive or negative zero nor NaN - a
  7162.           node-set is true if and only if it is non-empty - a string
  7163.            is true if and only if its length is non-zero '''
  7164.         libxml2mod.xmlXPathBooleanFunction(self._o, nargs)
  7165.  
  7166.     
  7167.     def xpathCeilingFunction(self, nargs):
  7168.         '''Implement the ceiling() XPath function number
  7169.           ceiling(number) The ceiling function returns the smallest
  7170.           (closest to negative infinity) number that is not less than
  7171.            the argument and that is an integer. '''
  7172.         libxml2mod.xmlXPathCeilingFunction(self._o, nargs)
  7173.  
  7174.     
  7175.     def xpathCompareValues(self, inf, strict):
  7176.         '''Implement the compare operation on XPath objects: @arg1 <
  7177.           @arg2    (1, 1, ... @arg1 <= @arg2   (1, 0, ... @arg1 >
  7178.           @arg2    (0, 1, ... @arg1 >= @arg2   (0, 0, ...  When
  7179.           neither object to be compared is a node-set and the
  7180.           operator is <=, <, >=, >, then the objects are compared by
  7181.           converted both objects to numbers and comparing the numbers
  7182.           according to IEEE 754. The < comparison will be true if and
  7183.           only if the first number is less than the second number.
  7184.           The <= comparison will be true if and only if the first
  7185.           number is less than or equal to the second number. The >
  7186.           comparison will be true if and only if the first number is
  7187.           greater than the second number. The >= comparison will be
  7188.           true if and only if the first number is greater than or
  7189.            equal to the second number. '''
  7190.         ret = libxml2mod.xmlXPathCompareValues(self._o, inf, strict)
  7191.         return ret
  7192.  
  7193.     
  7194.     def xpathConcatFunction(self, nargs):
  7195.         '''Implement the concat() XPath function string concat(string,
  7196.           string, string*) The concat function returns the
  7197.            concatenation of its arguments. '''
  7198.         libxml2mod.xmlXPathConcatFunction(self._o, nargs)
  7199.  
  7200.     
  7201.     def xpathContainsFunction(self, nargs):
  7202.         '''Implement the contains() XPath function boolean
  7203.           contains(string, string) The contains function returns true
  7204.           if the first argument string contains the second argument
  7205.            string, and otherwise returns false. '''
  7206.         libxml2mod.xmlXPathContainsFunction(self._o, nargs)
  7207.  
  7208.     
  7209.     def xpathCountFunction(self, nargs):
  7210.         '''Implement the count() XPath function number count(node-set) '''
  7211.         libxml2mod.xmlXPathCountFunction(self._o, nargs)
  7212.  
  7213.     
  7214.     def xpathDivValues(self):
  7215.         '''Implement the div operation on XPath objects @arg1 / @arg2:
  7216.           The numeric operators convert their operands to numbers as
  7217.            if by calling the number function. '''
  7218.         libxml2mod.xmlXPathDivValues(self._o)
  7219.  
  7220.     
  7221.     def xpathEqualValues(self):
  7222.         '''Implement the equal operation on XPath objects content:
  7223.            @arg1 == @arg2 '''
  7224.         ret = libxml2mod.xmlXPathEqualValues(self._o)
  7225.         return ret
  7226.  
  7227.     
  7228.     def xpathErr(self, error):
  7229.         '''Handle an XPath error '''
  7230.         libxml2mod.xmlXPathErr(self._o, error)
  7231.  
  7232.     
  7233.     def xpathEvalExpr(self):
  7234.         '''Parse and evaluate an XPath expression in the given
  7235.            context, then push the result on the context stack '''
  7236.         libxml2mod.xmlXPathEvalExpr(self._o)
  7237.  
  7238.     
  7239.     def xpathFalseFunction(self, nargs):
  7240.         '''Implement the false() XPath function boolean false() '''
  7241.         libxml2mod.xmlXPathFalseFunction(self._o, nargs)
  7242.  
  7243.     
  7244.     def xpathFloorFunction(self, nargs):
  7245.         '''Implement the floor() XPath function number floor(number)
  7246.           The floor function returns the largest (closest to positive
  7247.           infinity) number that is not greater than the argument and
  7248.            that is an integer. '''
  7249.         libxml2mod.xmlXPathFloorFunction(self._o, nargs)
  7250.  
  7251.     
  7252.     def xpathFreeParserContext(self):
  7253.         '''Free up an xmlXPathParserContext '''
  7254.         libxml2mod.xmlXPathFreeParserContext(self._o)
  7255.  
  7256.     
  7257.     def xpathIdFunction(self, nargs):
  7258.         '''Implement the id() XPath function node-set id(object) The
  7259.           id function selects elements by their unique ID (see [5.2.1
  7260.           Unique IDs]). When the argument to id is of type node-set,
  7261.           then the result is the union of the result of applying id
  7262.           to the string value of each of the nodes in the argument
  7263.           node-set. When the argument to id is of any other type, the
  7264.           argument is converted to a string as if by a call to the
  7265.           string function; the string is split into a
  7266.           whitespace-separated list of tokens (whitespace is any
  7267.           sequence of characters matching the production S); the
  7268.           result is a node-set containing the elements in the same
  7269.           document as the context node that have a unique ID equal to
  7270.            any of the tokens in the list. '''
  7271.         libxml2mod.xmlXPathIdFunction(self._o, nargs)
  7272.  
  7273.     
  7274.     def xpathLangFunction(self, nargs):
  7275.         '''Implement the lang() XPath function boolean lang(string)
  7276.           The lang function returns true or false depending on
  7277.           whether the language of the context node as specified by
  7278.           xml:lang attributes is the same as or is a sublanguage of
  7279.           the language specified by the argument string. The language
  7280.           of the context node is determined by the value of the
  7281.           xml:lang attribute on the context node, or, if the context
  7282.           node has no xml:lang attribute, by the value of the
  7283.           xml:lang attribute on the nearest ancestor of the context
  7284.           node that has an xml:lang attribute. If there is no such
  7285.            attribute, then lang '''
  7286.         libxml2mod.xmlXPathLangFunction(self._o, nargs)
  7287.  
  7288.     
  7289.     def xpathLastFunction(self, nargs):
  7290.         '''Implement the last() XPath function number last() The last
  7291.           function returns the number of nodes in the context node
  7292.            list. '''
  7293.         libxml2mod.xmlXPathLastFunction(self._o, nargs)
  7294.  
  7295.     
  7296.     def xpathLocalNameFunction(self, nargs):
  7297.         '''Implement the local-name() XPath function string
  7298.           local-name(node-set?) The local-name function returns a
  7299.           string containing the local part of the name of the node in
  7300.           the argument node-set that is first in document order. If
  7301.           the node-set is empty or the first node has no name, an
  7302.           empty string is returned. If the argument is omitted it
  7303.            defaults to the context node. '''
  7304.         libxml2mod.xmlXPathLocalNameFunction(self._o, nargs)
  7305.  
  7306.     
  7307.     def xpathModValues(self):
  7308.         '''Implement the mod operation on XPath objects: @arg1 / @arg2
  7309.           The numeric operators convert their operands to numbers as
  7310.            if by calling the number function. '''
  7311.         libxml2mod.xmlXPathModValues(self._o)
  7312.  
  7313.     
  7314.     def xpathMultValues(self):
  7315.         '''Implement the multiply operation on XPath objects: The
  7316.           numeric operators convert their operands to numbers as if
  7317.            by calling the number function. '''
  7318.         libxml2mod.xmlXPathMultValues(self._o)
  7319.  
  7320.     
  7321.     def xpathNamespaceURIFunction(self, nargs):
  7322.         '''Implement the namespace-uri() XPath function string
  7323.           namespace-uri(node-set?) The namespace-uri function returns
  7324.           a string containing the namespace URI of the expanded name
  7325.           of the node in the argument node-set that is first in
  7326.           document order. If the node-set is empty, the first node
  7327.           has no name, or the expanded name has no namespace URI, an
  7328.           empty string is returned. If the argument is omitted it
  7329.            defaults to the context node. '''
  7330.         libxml2mod.xmlXPathNamespaceURIFunction(self._o, nargs)
  7331.  
  7332.     
  7333.     def xpathNextAncestor(self, cur):
  7334.         '''Traversal function for the "ancestor" direction the
  7335.           ancestor axis contains the ancestors of the context node;
  7336.           the ancestors of the context node consist of the parent of
  7337.           context node and the parent\'s parent and so on; the nodes
  7338.           are ordered in reverse document order; thus the parent is
  7339.           the first node on the axis, and the parent\'s parent is the
  7340.            second node on the axis '''
  7341.         if cur is None:
  7342.             cur__o = None
  7343.         else:
  7344.             cur__o = cur._o
  7345.         ret = libxml2mod.xmlXPathNextAncestor(self._o, cur__o)
  7346.         if ret is None:
  7347.             raise xpathError('xmlXPathNextAncestor() failed')
  7348.         ret is None
  7349.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7350.         return _xpathParserContext__tmp
  7351.  
  7352.     
  7353.     def xpathNextAncestorOrSelf(self, cur):
  7354.         '''Traversal function for the "ancestor-or-self" direction he
  7355.           ancestor-or-self axis contains the context node and
  7356.           ancestors of the context node in reverse document order;
  7357.           thus the context node is the first node on the axis, and
  7358.           the context node\'s parent the second; parent here is
  7359.            defined the same as with the parent axis. '''
  7360.         if cur is None:
  7361.             cur__o = None
  7362.         else:
  7363.             cur__o = cur._o
  7364.         ret = libxml2mod.xmlXPathNextAncestorOrSelf(self._o, cur__o)
  7365.         if ret is None:
  7366.             raise xpathError('xmlXPathNextAncestorOrSelf() failed')
  7367.         ret is None
  7368.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7369.         return _xpathParserContext__tmp
  7370.  
  7371.     
  7372.     def xpathNextAttribute(self, cur):
  7373.         '''Traversal function for the "attribute" direction TODO:
  7374.            support DTD inherited default attributes '''
  7375.         if cur is None:
  7376.             cur__o = None
  7377.         else:
  7378.             cur__o = cur._o
  7379.         ret = libxml2mod.xmlXPathNextAttribute(self._o, cur__o)
  7380.         if ret is None:
  7381.             raise xpathError('xmlXPathNextAttribute() failed')
  7382.         ret is None
  7383.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7384.         return _xpathParserContext__tmp
  7385.  
  7386.     
  7387.     def xpathNextChild(self, cur):
  7388.         '''Traversal function for the "child" direction The child axis
  7389.           contains the children of the context node in document order. '''
  7390.         if cur is None:
  7391.             cur__o = None
  7392.         else:
  7393.             cur__o = cur._o
  7394.         ret = libxml2mod.xmlXPathNextChild(self._o, cur__o)
  7395.         if ret is None:
  7396.             raise xpathError('xmlXPathNextChild() failed')
  7397.         ret is None
  7398.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7399.         return _xpathParserContext__tmp
  7400.  
  7401.     
  7402.     def xpathNextDescendant(self, cur):
  7403.         '''Traversal function for the "descendant" direction the
  7404.           descendant axis contains the descendants of the context
  7405.           node in document order; a descendant is a child or a child
  7406.            of a child and so on. '''
  7407.         if cur is None:
  7408.             cur__o = None
  7409.         else:
  7410.             cur__o = cur._o
  7411.         ret = libxml2mod.xmlXPathNextDescendant(self._o, cur__o)
  7412.         if ret is None:
  7413.             raise xpathError('xmlXPathNextDescendant() failed')
  7414.         ret is None
  7415.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7416.         return _xpathParserContext__tmp
  7417.  
  7418.     
  7419.     def xpathNextDescendantOrSelf(self, cur):
  7420.         '''Traversal function for the "descendant-or-self" direction
  7421.           the descendant-or-self axis contains the context node and
  7422.           the descendants of the context node in document order; thus
  7423.           the context node is the first node on the axis, and the
  7424.           first child of the context node is the second node on the
  7425.            axis '''
  7426.         if cur is None:
  7427.             cur__o = None
  7428.         else:
  7429.             cur__o = cur._o
  7430.         ret = libxml2mod.xmlXPathNextDescendantOrSelf(self._o, cur__o)
  7431.         if ret is None:
  7432.             raise xpathError('xmlXPathNextDescendantOrSelf() failed')
  7433.         ret is None
  7434.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7435.         return _xpathParserContext__tmp
  7436.  
  7437.     
  7438.     def xpathNextFollowing(self, cur):
  7439.         '''Traversal function for the "following" direction The
  7440.           following axis contains all nodes in the same document as
  7441.           the context node that are after the context node in
  7442.           document order, excluding any descendants and excluding
  7443.           attribute nodes and namespace nodes; the nodes are ordered
  7444.            in document order '''
  7445.         if cur is None:
  7446.             cur__o = None
  7447.         else:
  7448.             cur__o = cur._o
  7449.         ret = libxml2mod.xmlXPathNextFollowing(self._o, cur__o)
  7450.         if ret is None:
  7451.             raise xpathError('xmlXPathNextFollowing() failed')
  7452.         ret is None
  7453.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7454.         return _xpathParserContext__tmp
  7455.  
  7456.     
  7457.     def xpathNextFollowingSibling(self, cur):
  7458.         '''Traversal function for the "following-sibling" direction
  7459.           The following-sibling axis contains the following siblings
  7460.            of the context node in document order. '''
  7461.         if cur is None:
  7462.             cur__o = None
  7463.         else:
  7464.             cur__o = cur._o
  7465.         ret = libxml2mod.xmlXPathNextFollowingSibling(self._o, cur__o)
  7466.         if ret is None:
  7467.             raise xpathError('xmlXPathNextFollowingSibling() failed')
  7468.         ret is None
  7469.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7470.         return _xpathParserContext__tmp
  7471.  
  7472.     
  7473.     def xpathNextNamespace(self, cur):
  7474.         '''Traversal function for the "namespace" direction the
  7475.           namespace axis contains the namespace nodes of the context
  7476.           node; the order of nodes on this axis is
  7477.           implementation-defined; the axis will be empty unless the
  7478.           context node is an element  We keep the XML namespace node
  7479.            at the end of the list. '''
  7480.         if cur is None:
  7481.             cur__o = None
  7482.         else:
  7483.             cur__o = cur._o
  7484.         ret = libxml2mod.xmlXPathNextNamespace(self._o, cur__o)
  7485.         if ret is None:
  7486.             raise xpathError('xmlXPathNextNamespace() failed')
  7487.         ret is None
  7488.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7489.         return _xpathParserContext__tmp
  7490.  
  7491.     
  7492.     def xpathNextParent(self, cur):
  7493.         '''Traversal function for the "parent" direction The parent
  7494.           axis contains the parent of the context node, if there is
  7495.            one. '''
  7496.         if cur is None:
  7497.             cur__o = None
  7498.         else:
  7499.             cur__o = cur._o
  7500.         ret = libxml2mod.xmlXPathNextParent(self._o, cur__o)
  7501.         if ret is None:
  7502.             raise xpathError('xmlXPathNextParent() failed')
  7503.         ret is None
  7504.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7505.         return _xpathParserContext__tmp
  7506.  
  7507.     
  7508.     def xpathNextPreceding(self, cur):
  7509.         '''Traversal function for the "preceding" direction the
  7510.           preceding axis contains all nodes in the same document as
  7511.           the context node that are before the context node in
  7512.           document order, excluding any ancestors and excluding
  7513.           attribute nodes and namespace nodes; the nodes are ordered
  7514.            in reverse document order '''
  7515.         if cur is None:
  7516.             cur__o = None
  7517.         else:
  7518.             cur__o = cur._o
  7519.         ret = libxml2mod.xmlXPathNextPreceding(self._o, cur__o)
  7520.         if ret is None:
  7521.             raise xpathError('xmlXPathNextPreceding() failed')
  7522.         ret is None
  7523.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7524.         return _xpathParserContext__tmp
  7525.  
  7526.     
  7527.     def xpathNextPrecedingSibling(self, cur):
  7528.         '''Traversal function for the "preceding-sibling" direction
  7529.           The preceding-sibling axis contains the preceding siblings
  7530.           of the context node in reverse document order; the first
  7531.           preceding sibling is first on the axis; the sibling
  7532.            preceding that node is the second on the axis and so on. '''
  7533.         if cur is None:
  7534.             cur__o = None
  7535.         else:
  7536.             cur__o = cur._o
  7537.         ret = libxml2mod.xmlXPathNextPrecedingSibling(self._o, cur__o)
  7538.         if ret is None:
  7539.             raise xpathError('xmlXPathNextPrecedingSibling() failed')
  7540.         ret is None
  7541.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7542.         return _xpathParserContext__tmp
  7543.  
  7544.     
  7545.     def xpathNextSelf(self, cur):
  7546.         '''Traversal function for the "self" direction The self axis
  7547.            contains just the context node itself '''
  7548.         if cur is None:
  7549.             cur__o = None
  7550.         else:
  7551.             cur__o = cur._o
  7552.         ret = libxml2mod.xmlXPathNextSelf(self._o, cur__o)
  7553.         if ret is None:
  7554.             raise xpathError('xmlXPathNextSelf() failed')
  7555.         ret is None
  7556.         _xpathParserContext__tmp = xmlNode(_obj = ret)
  7557.         return _xpathParserContext__tmp
  7558.  
  7559.     
  7560.     def xpathNormalizeFunction(self, nargs):
  7561.         '''Implement the normalize-space() XPath function string
  7562.           normalize-space(string?) The normalize-space function
  7563.           returns the argument string with white space normalized by
  7564.           stripping leading and trailing whitespace and replacing
  7565.           sequences of whitespace characters by a single space.
  7566.           Whitespace characters are the same allowed by the S
  7567.           production in XML. If the argument is omitted, it defaults
  7568.           to the context node converted to a string, in other words
  7569.            the value of the context node. '''
  7570.         libxml2mod.xmlXPathNormalizeFunction(self._o, nargs)
  7571.  
  7572.     
  7573.     def xpathNotEqualValues(self):
  7574.         '''Implement the equal operation on XPath objects content:
  7575.            @arg1 == @arg2 '''
  7576.         ret = libxml2mod.xmlXPathNotEqualValues(self._o)
  7577.         return ret
  7578.  
  7579.     
  7580.     def xpathNotFunction(self, nargs):
  7581.         '''Implement the not() XPath function boolean not(boolean) The
  7582.           not function returns true if its argument is false, and
  7583.            false otherwise. '''
  7584.         libxml2mod.xmlXPathNotFunction(self._o, nargs)
  7585.  
  7586.     
  7587.     def xpathNumberFunction(self, nargs):
  7588.         '''Implement the number() XPath function number number(object?) '''
  7589.         libxml2mod.xmlXPathNumberFunction(self._o, nargs)
  7590.  
  7591.     
  7592.     def xpathParseNCName(self):
  7593.         """parse an XML namespace non qualified name.  [NS 3] NCName
  7594.           ::= (Letter | '_') (NCNameChar)*  [NS 4] NCNameChar ::=
  7595.            Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender """
  7596.         ret = libxml2mod.xmlXPathParseNCName(self._o)
  7597.         return ret
  7598.  
  7599.     
  7600.     def xpathParseName(self):
  7601.         """parse an XML name  [4] NameChar ::= Letter | Digit | '.' |
  7602.           '-' | '_' | ':' | CombiningChar | Extender  [5] Name ::=
  7603.            (Letter | '_' | ':') (NameChar)* """
  7604.         ret = libxml2mod.xmlXPathParseName(self._o)
  7605.         return ret
  7606.  
  7607.     
  7608.     def xpathPopBoolean(self):
  7609.         '''Pops a boolean from the stack, handling conversion if
  7610.            needed. Check error with #xmlXPathCheckError. '''
  7611.         ret = libxml2mod.xmlXPathPopBoolean(self._o)
  7612.         return ret
  7613.  
  7614.     
  7615.     def xpathPopNumber(self):
  7616.         '''Pops a number from the stack, handling conversion if
  7617.            needed. Check error with #xmlXPathCheckError. '''
  7618.         ret = libxml2mod.xmlXPathPopNumber(self._o)
  7619.         return ret
  7620.  
  7621.     
  7622.     def xpathPopString(self):
  7623.         '''Pops a string from the stack, handling conversion if
  7624.            needed. Check error with #xmlXPathCheckError. '''
  7625.         ret = libxml2mod.xmlXPathPopString(self._o)
  7626.         return ret
  7627.  
  7628.     
  7629.     def xpathPositionFunction(self, nargs):
  7630.         '''Implement the position() XPath function number position()
  7631.           The position function returns the position of the context
  7632.           node in the context node list. The first position is 1, and
  7633.            so the last position will be equal to last(). '''
  7634.         libxml2mod.xmlXPathPositionFunction(self._o, nargs)
  7635.  
  7636.     
  7637.     def xpathRoot(self):
  7638.         '''Initialize the context to the root of the document '''
  7639.         libxml2mod.xmlXPathRoot(self._o)
  7640.  
  7641.     
  7642.     def xpathRoundFunction(self, nargs):
  7643.         '''Implement the round() XPath function number round(number)
  7644.           The round function returns the number that is closest to
  7645.           the argument and that is an integer. If there are two such
  7646.            numbers, then the one that is even is returned. '''
  7647.         libxml2mod.xmlXPathRoundFunction(self._o, nargs)
  7648.  
  7649.     
  7650.     def xpathStartsWithFunction(self, nargs):
  7651.         '''Implement the starts-with() XPath function boolean
  7652.           starts-with(string, string) The starts-with function
  7653.           returns true if the first argument string starts with the
  7654.            second argument string, and otherwise returns false. '''
  7655.         libxml2mod.xmlXPathStartsWithFunction(self._o, nargs)
  7656.  
  7657.     
  7658.     def xpathStringFunction(self, nargs):
  7659.         '''Implement the string() XPath function string
  7660.           string(object?) The string function converts an object to a
  7661.           string as follows: - A node-set is converted to a string by
  7662.           returning the value of the node in the node-set that is
  7663.           first in document order. If the node-set is empty, an empty
  7664.           string is returned. - A number is converted to a string as
  7665.           follows + NaN is converted to the string NaN + positive
  7666.           zero is converted to the string 0 + negative zero is
  7667.           converted to the string 0 + positive infinity is converted
  7668.           to the string Infinity + negative infinity is converted to
  7669.           the string -Infinity + if the number is an integer, the
  7670.           number is represented in decimal form as a Number with no
  7671.           decimal point and no leading zeros, preceded by a minus
  7672.           sign (-) if the number is negative + otherwise, the number
  7673.           is represented in decimal form as a Number including a
  7674.           decimal point with at least one digit before the decimal
  7675.           point and at least one digit after the decimal point,
  7676.           preceded by a minus sign (-) if the number is negative;
  7677.           there must be no leading zeros before the decimal point
  7678.           apart possibly from the one required digit immediately
  7679.           before the decimal point; beyond the one required digit
  7680.           after the decimal point there must be as many, but only as
  7681.           many, more digits as are needed to uniquely distinguish the
  7682.           number from all other IEEE 754 numeric values. - The
  7683.           boolean false value is converted to the string false. The
  7684.           boolean true value is converted to the string true.  If the
  7685.           argument is omitted, it defaults to a node-set with the
  7686.            context node as its only member. '''
  7687.         libxml2mod.xmlXPathStringFunction(self._o, nargs)
  7688.  
  7689.     
  7690.     def xpathStringLengthFunction(self, nargs):
  7691.         '''Implement the string-length() XPath function number
  7692.           string-length(string?) The string-length returns the number
  7693.           of characters in the string (see [3.6 Strings]). If the
  7694.           argument is omitted, it defaults to the context node
  7695.           converted to a string, in other words the value of the
  7696.            context node. '''
  7697.         libxml2mod.xmlXPathStringLengthFunction(self._o, nargs)
  7698.  
  7699.     
  7700.     def xpathSubValues(self):
  7701.         '''Implement the subtraction operation on XPath objects: The
  7702.           numeric operators convert their operands to numbers as if
  7703.            by calling the number function. '''
  7704.         libxml2mod.xmlXPathSubValues(self._o)
  7705.  
  7706.     
  7707.     def xpathSubstringAfterFunction(self, nargs):
  7708.         '''Implement the substring-after() XPath function string
  7709.           substring-after(string, string) The substring-after
  7710.           function returns the substring of the first argument string
  7711.           that follows the first occurrence of the second argument
  7712.           string in the first argument string, or the empty stringi
  7713.           if the first argument string does not contain the second
  7714.           argument string. For example,
  7715.           substring-after("1999/04/01","/") returns 04/01, and
  7716.            substring-after("1999/04/01","19") returns 99/04/01. '''
  7717.         libxml2mod.xmlXPathSubstringAfterFunction(self._o, nargs)
  7718.  
  7719.     
  7720.     def xpathSubstringBeforeFunction(self, nargs):
  7721.         '''Implement the substring-before() XPath function string
  7722.           substring-before(string, string) The substring-before
  7723.           function returns the substring of the first argument string
  7724.           that precedes the first occurrence of the second argument
  7725.           string in the first argument string, or the empty string if
  7726.           the first argument string does not contain the second
  7727.           argument string. For example,
  7728.            substring-before("1999/04/01","/") returns 1999. '''
  7729.         libxml2mod.xmlXPathSubstringBeforeFunction(self._o, nargs)
  7730.  
  7731.     
  7732.     def xpathSubstringFunction(self, nargs):
  7733.         '''Implement the substring() XPath function string
  7734.           substring(string, number, number?) The substring function
  7735.           returns the substring of the first argument starting at the
  7736.           position specified in the second argument with length
  7737.           specified in the third argument. For example,
  7738.           substring("12345",2,3) returns "234". If the third argument
  7739.           is not specified, it returns the substring starting at the
  7740.           position specified in the second argument and continuing to
  7741.           the end of the string. For example, substring("12345",2)
  7742.           returns "2345".  More precisely, each character in the
  7743.           string (see [3.6 Strings]) is considered to have a numeric
  7744.           position: the position of the first character is 1, the
  7745.           position of the second character is 2 and so on. The
  7746.           returned substring contains those characters for which the
  7747.           position of the character is greater than or equal to the
  7748.           second argument and, if the third argument is specified,
  7749.           less than the sum of the second and third arguments; the
  7750.           comparisons and addition used for the above follow the
  7751.           standard IEEE 754 rules. Thus: - substring("12345", 1.5,
  7752.           2.6) returns "234" - substring("12345", 0, 3) returns "12"
  7753.           - substring("12345", 0 div 0, 3) returns "" -
  7754.           substring("12345", 1, 0 div 0) returns "" -
  7755.           substring("12345", -42, 1 div 0) returns "12345" -
  7756.            substring("12345", -1 div 0, 1 div 0) returns "" '''
  7757.         libxml2mod.xmlXPathSubstringFunction(self._o, nargs)
  7758.  
  7759.     
  7760.     def xpathSumFunction(self, nargs):
  7761.         '''Implement the sum() XPath function number sum(node-set) The
  7762.           sum function returns the sum of the values of the nodes in
  7763.            the argument node-set. '''
  7764.         libxml2mod.xmlXPathSumFunction(self._o, nargs)
  7765.  
  7766.     
  7767.     def xpathTranslateFunction(self, nargs):
  7768.         '''Implement the translate() XPath function string
  7769.           translate(string, string, string) The translate function
  7770.           returns the first argument string with occurrences of
  7771.           characters in the second argument string replaced by the
  7772.           character at the corresponding position in the third
  7773.           argument string. For example, translate("bar","abc","ABC")
  7774.           returns the string BAr. If there is a character in the
  7775.           second argument string with no character at a corresponding
  7776.           position in the third argument string (because the second
  7777.           argument string is longer than the third argument string),
  7778.           then occurrences of that character in the first argument
  7779.           string are removed. For example,
  7780.            translate("--aaa--","abc-","ABC") '''
  7781.         libxml2mod.xmlXPathTranslateFunction(self._o, nargs)
  7782.  
  7783.     
  7784.     def xpathTrueFunction(self, nargs):
  7785.         '''Implement the true() XPath function boolean true() '''
  7786.         libxml2mod.xmlXPathTrueFunction(self._o, nargs)
  7787.  
  7788.     
  7789.     def xpathValueFlipSign(self):
  7790.         '''Implement the unary - operation on an XPath object The
  7791.           numeric operators convert their operands to numbers as if
  7792.            by calling the number function. '''
  7793.         libxml2mod.xmlXPathValueFlipSign(self._o)
  7794.  
  7795.     
  7796.     def xpatherror(self, file, line, no):
  7797.         '''Formats an error message. '''
  7798.         libxml2mod.xmlXPatherror(self._o, file, line, no)
  7799.  
  7800.     
  7801.     def xpointerEvalRangePredicate(self):
  7802.         """[8]   Predicate ::=   '[' PredicateExpr ']' [9]  
  7803.           PredicateExpr ::=   Expr  Evaluate a predicate as in
  7804.           xmlXPathEvalPredicate() but for a Location Set instead of a
  7805.            node set """
  7806.         libxml2mod.xmlXPtrEvalRangePredicate(self._o)
  7807.  
  7808.     
  7809.     def xpointerRangeToFunction(self, nargs):
  7810.         '''Implement the range-to() XPointer function '''
  7811.         libxml2mod.xmlXPtrRangeToFunction(self._o, nargs)
  7812.  
  7813.  
  7814.  
  7815. class parserCtxt(parserCtxtCore):
  7816.     
  7817.     def __init__(self, _obj = None):
  7818.         self._o = _obj
  7819.         parserCtxtCore.__init__(self, _obj = _obj)
  7820.  
  7821.     
  7822.     def __del__(self):
  7823.         if self._o != None:
  7824.             libxml2mod.xmlFreeParserCtxt(self._o)
  7825.         
  7826.         self._o = None
  7827.  
  7828.     
  7829.     def doc(self):
  7830.         '''Get the document tree from a parser context. '''
  7831.         ret = libxml2mod.xmlParserGetDoc(self._o)
  7832.         if ret is None:
  7833.             raise parserError('xmlParserGetDoc() failed')
  7834.         ret is None
  7835.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  7836.         return _parserCtxt__tmp
  7837.  
  7838.     
  7839.     def isValid(self):
  7840.         '''Get the validity information from a parser context. '''
  7841.         ret = libxml2mod.xmlParserGetIsValid(self._o)
  7842.         return ret
  7843.  
  7844.     
  7845.     def lineNumbers(self, linenumbers):
  7846.         '''Switch on the generation of line number for elements nodes. '''
  7847.         libxml2mod.xmlParserSetLineNumbers(self._o, linenumbers)
  7848.  
  7849.     
  7850.     def loadSubset(self, loadsubset):
  7851.         '''Switch the parser to load the DTD without validating. '''
  7852.         libxml2mod.xmlParserSetLoadSubset(self._o, loadsubset)
  7853.  
  7854.     
  7855.     def pedantic(self, pedantic):
  7856.         '''Switch the parser to be pedantic. '''
  7857.         libxml2mod.xmlParserSetPedantic(self._o, pedantic)
  7858.  
  7859.     
  7860.     def replaceEntities(self, replaceEntities):
  7861.         '''Switch the parser to replace entities. '''
  7862.         libxml2mod.xmlParserSetReplaceEntities(self._o, replaceEntities)
  7863.  
  7864.     
  7865.     def validate(self, validate):
  7866.         '''Switch the parser to validation mode. '''
  7867.         libxml2mod.xmlParserSetValidate(self._o, validate)
  7868.  
  7869.     
  7870.     def wellFormed(self):
  7871.         '''Get the well formed information from a parser context. '''
  7872.         ret = libxml2mod.xmlParserGetWellFormed(self._o)
  7873.         return ret
  7874.  
  7875.     
  7876.     def htmlCtxtReadDoc(self, cur, URL, encoding, options):
  7877.         '''parse an XML in-memory document and build a tree. This
  7878.            reuses the existing @ctxt parser context '''
  7879.         ret = libxml2mod.htmlCtxtReadDoc(self._o, cur, URL, encoding, options)
  7880.         if ret is None:
  7881.             raise treeError('htmlCtxtReadDoc() failed')
  7882.         ret is None
  7883.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  7884.         return _parserCtxt__tmp
  7885.  
  7886.     
  7887.     def htmlCtxtReadFd(self, fd, URL, encoding, options):
  7888.         '''parse an XML from a file descriptor and build a tree. This
  7889.            reuses the existing @ctxt parser context '''
  7890.         ret = libxml2mod.htmlCtxtReadFd(self._o, fd, URL, encoding, options)
  7891.         if ret is None:
  7892.             raise treeError('htmlCtxtReadFd() failed')
  7893.         ret is None
  7894.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  7895.         return _parserCtxt__tmp
  7896.  
  7897.     
  7898.     def htmlCtxtReadFile(self, filename, encoding, options):
  7899.         '''parse an XML file from the filesystem or the network. This
  7900.            reuses the existing @ctxt parser context '''
  7901.         ret = libxml2mod.htmlCtxtReadFile(self._o, filename, encoding, options)
  7902.         if ret is None:
  7903.             raise treeError('htmlCtxtReadFile() failed')
  7904.         ret is None
  7905.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  7906.         return _parserCtxt__tmp
  7907.  
  7908.     
  7909.     def htmlCtxtReadMemory(self, buffer, size, URL, encoding, options):
  7910.         '''parse an XML in-memory document and build a tree. This
  7911.            reuses the existing @ctxt parser context '''
  7912.         ret = libxml2mod.htmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
  7913.         if ret is None:
  7914.             raise treeError('htmlCtxtReadMemory() failed')
  7915.         ret is None
  7916.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  7917.         return _parserCtxt__tmp
  7918.  
  7919.     
  7920.     def htmlCtxtReset(self):
  7921.         '''Reset a parser context '''
  7922.         libxml2mod.htmlCtxtReset(self._o)
  7923.  
  7924.     
  7925.     def htmlCtxtUseOptions(self, options):
  7926.         '''Applies the options to the parser context '''
  7927.         ret = libxml2mod.htmlCtxtUseOptions(self._o, options)
  7928.         return ret
  7929.  
  7930.     
  7931.     def htmlFreeParserCtxt(self):
  7932.         '''Free all the memory used by a parser context. However the
  7933.            parsed document in ctxt->myDoc is not freed. '''
  7934.         libxml2mod.htmlFreeParserCtxt(self._o)
  7935.  
  7936.     
  7937.     def htmlParseCharRef(self):
  7938.         """parse Reference declarations  [66] CharRef ::= '&#' [0-9]+
  7939.            ';' | '&#x' [0-9a-fA-F]+ ';' """
  7940.         ret = libxml2mod.htmlParseCharRef(self._o)
  7941.         return ret
  7942.  
  7943.     
  7944.     def htmlParseChunk(self, chunk, size, terminate):
  7945.         '''Parse a Chunk of memory '''
  7946.         ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate)
  7947.         return ret
  7948.  
  7949.     
  7950.     def htmlParseDocument(self):
  7951.         '''parse an HTML document (and build a tree if using the
  7952.            standard SAX interface). '''
  7953.         ret = libxml2mod.htmlParseDocument(self._o)
  7954.         return ret
  7955.  
  7956.     
  7957.     def htmlParseElement(self):
  7958.         '''parse an HTML element, this is highly recursive  [39]
  7959.           element ::= EmptyElemTag | STag content ETag  [41]
  7960.            Attribute ::= Name Eq AttValue '''
  7961.         libxml2mod.htmlParseElement(self._o)
  7962.  
  7963.     
  7964.     def byteConsumed(self):
  7965.         '''This function provides the current index of the parser
  7966.           relative to the start of the current entity. This function
  7967.           is computed in bytes from the beginning starting at zero
  7968.           and finishing at the size in byte of the file if parsing a
  7969.           file. The function is of constant cost if the input is
  7970.            UTF-8 but can be costly if run on non-UTF-8 input. '''
  7971.         ret = libxml2mod.xmlByteConsumed(self._o)
  7972.         return ret
  7973.  
  7974.     
  7975.     def clearParserCtxt(self):
  7976.         '''Clear (release owned resources) and reinitialize a parser
  7977.            context '''
  7978.         libxml2mod.xmlClearParserCtxt(self._o)
  7979.  
  7980.     
  7981.     def ctxtReadDoc(self, cur, URL, encoding, options):
  7982.         '''parse an XML in-memory document and build a tree. This
  7983.            reuses the existing @ctxt parser context '''
  7984.         ret = libxml2mod.xmlCtxtReadDoc(self._o, cur, URL, encoding, options)
  7985.         if ret is None:
  7986.             raise treeError('xmlCtxtReadDoc() failed')
  7987.         ret is None
  7988.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  7989.         return _parserCtxt__tmp
  7990.  
  7991.     
  7992.     def ctxtReadFd(self, fd, URL, encoding, options):
  7993.         '''parse an XML from a file descriptor and build a tree. This
  7994.           reuses the existing @ctxt parser context NOTE that the file
  7995.           descriptor will not be closed when the reader is closed or
  7996.            reset. '''
  7997.         ret = libxml2mod.xmlCtxtReadFd(self._o, fd, URL, encoding, options)
  7998.         if ret is None:
  7999.             raise treeError('xmlCtxtReadFd() failed')
  8000.         ret is None
  8001.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  8002.         return _parserCtxt__tmp
  8003.  
  8004.     
  8005.     def ctxtReadFile(self, filename, encoding, options):
  8006.         '''parse an XML file from the filesystem or the network. This
  8007.            reuses the existing @ctxt parser context '''
  8008.         ret = libxml2mod.xmlCtxtReadFile(self._o, filename, encoding, options)
  8009.         if ret is None:
  8010.             raise treeError('xmlCtxtReadFile() failed')
  8011.         ret is None
  8012.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  8013.         return _parserCtxt__tmp
  8014.  
  8015.     
  8016.     def ctxtReadMemory(self, buffer, size, URL, encoding, options):
  8017.         '''parse an XML in-memory document and build a tree. This
  8018.            reuses the existing @ctxt parser context '''
  8019.         ret = libxml2mod.xmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
  8020.         if ret is None:
  8021.             raise treeError('xmlCtxtReadMemory() failed')
  8022.         ret is None
  8023.         _parserCtxt__tmp = xmlDoc(_obj = ret)
  8024.         return _parserCtxt__tmp
  8025.  
  8026.     
  8027.     def ctxtReset(self):
  8028.         '''Reset a parser context '''
  8029.         libxml2mod.xmlCtxtReset(self._o)
  8030.  
  8031.     
  8032.     def ctxtResetPush(self, chunk, size, filename, encoding):
  8033.         '''Reset a push parser context '''
  8034.         ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding)
  8035.         return ret
  8036.  
  8037.     
  8038.     def ctxtUseOptions(self, options):
  8039.         '''Applies the options to the parser context '''
  8040.         ret = libxml2mod.xmlCtxtUseOptions(self._o, options)
  8041.         return ret
  8042.  
  8043.     
  8044.     def initParserCtxt(self):
  8045.         '''Initialize a parser context '''
  8046.         ret = libxml2mod.xmlInitParserCtxt(self._o)
  8047.         return ret
  8048.  
  8049.     
  8050.     def parseChunk(self, chunk, size, terminate):
  8051.         '''Parse a Chunk of memory '''
  8052.         ret = libxml2mod.xmlParseChunk(self._o, chunk, size, terminate)
  8053.         return ret
  8054.  
  8055.     
  8056.     def parseDocument(self):
  8057.         '''parse an XML document (and build a tree if using the
  8058.           standard SAX interface).  [1] document ::= prolog element
  8059.            Misc*  [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? '''
  8060.         ret = libxml2mod.xmlParseDocument(self._o)
  8061.         return ret
  8062.  
  8063.     
  8064.     def parseExtParsedEnt(self):
  8065.         '''parse a general parsed entity An external general parsed
  8066.           entity is well-formed if it matches the production labeled
  8067.            extParsedEnt.  [78] extParsedEnt ::= TextDecl? content '''
  8068.         ret = libxml2mod.xmlParseExtParsedEnt(self._o)
  8069.         return ret
  8070.  
  8071.     
  8072.     def setupParserForBuffer(self, buffer, filename):
  8073.         '''Setup the parser context to parse a new buffer; Clears any
  8074.           prior contents from the parser context. The buffer
  8075.           parameter must not be None, but the filename parameter can
  8076.            be '''
  8077.         libxml2mod.xmlSetupParserForBuffer(self._o, buffer, filename)
  8078.  
  8079.     
  8080.     def stopParser(self):
  8081.         '''Blocks further parser processing '''
  8082.         libxml2mod.xmlStopParser(self._o)
  8083.  
  8084.     
  8085.     def decodeEntities(self, len, what, end, end2, end3):
  8086.         """This function is deprecated, we now always process entities
  8087.           content through xmlStringDecodeEntities  TODO: remove it in
  8088.           next major release.  [67] Reference ::= EntityRef | CharRef
  8089.             [69] PEReference ::= '%' Name ';' """
  8090.         ret = libxml2mod.xmlDecodeEntities(self._o, len, what, end, end2, end3)
  8091.         return ret
  8092.  
  8093.     
  8094.     def handleEntity(self, entity):
  8095.         '''Default handling of defined entities, when should we define
  8096.           a new input stream ? When do we just handle that as a set
  8097.            of chars ?  OBSOLETE: to be removed at some point. '''
  8098.         if entity is None:
  8099.             entity__o = None
  8100.         else:
  8101.             entity__o = entity._o
  8102.         libxml2mod.xmlHandleEntity(self._o, entity__o)
  8103.  
  8104.     
  8105.     def namespaceParseNCName(self):
  8106.         """parse an XML namespace name.  TODO: this seems not in use
  8107.           anymore, the namespace handling is done on top of the SAX
  8108.           interfaces, i.e. not on raw input.  [NS 3] NCName ::=
  8109.           (Letter | '_') (NCNameChar)*  [NS 4] NCNameChar ::= Letter
  8110.            | Digit | '.' | '-' | '_' | CombiningChar | Extender """
  8111.         ret = libxml2mod.xmlNamespaceParseNCName(self._o)
  8112.         return ret
  8113.  
  8114.     
  8115.     def namespaceParseNSDef(self):
  8116.         """parse a namespace prefix declaration  TODO: this seems not
  8117.           in use anymore, the namespace handling is done on top of
  8118.           the SAX interfaces, i.e. not on raw input.  [NS 1] NSDef
  8119.           ::= PrefixDef Eq SystemLiteral  [NS 2] PrefixDef ::=
  8120.            'xmlns' (':' NCName)? """
  8121.         ret = libxml2mod.xmlNamespaceParseNSDef(self._o)
  8122.         return ret
  8123.  
  8124.     
  8125.     def nextChar(self):
  8126.         '''Skip to the next char input char. '''
  8127.         libxml2mod.xmlNextChar(self._o)
  8128.  
  8129.     
  8130.     def parseAttValue(self):
  8131.         '''parse a value for an attribute Note: the parser won\'t do
  8132.           substitution of entities here, this will be handled later
  8133.           in xmlStringGetNodeList  [10] AttValue ::= \'"\' ([^<&"] |
  8134.           Reference)* \'"\' | "\'" ([^<&\'] | Reference)* "\'"  3.3.3
  8135.           Attribute-Value Normalization: Before the value of an
  8136.           attribute is passed to the application or checked for
  8137.           validity, the XML processor must normalize it as follows: -
  8138.           a character reference is processed by appending the
  8139.           referenced character to the attribute value - an entity
  8140.           reference is processed by recursively processing the
  8141.           replacement text of the entity - a whitespace character
  8142.           (#x20, #xD, #xA, #x9) is processed by appending #x20 to the
  8143.           normalized value, except that only a single #x20 is
  8144.           appended for a "#xD#xA" sequence that is part of an
  8145.           external parsed entity or the literal entity value of an
  8146.           internal parsed entity - other characters are processed by
  8147.           appending them to the normalized value If the declared
  8148.           value is not CDATA, then the XML processor must further
  8149.           process the normalized attribute value by discarding any
  8150.           leading and trailing space (#x20) characters, and by
  8151.           replacing sequences of space (#x20) characters by a single
  8152.           space (#x20) character. All attributes for which no
  8153.           declaration has been read should be treated by a
  8154.            non-validating parser as if declared CDATA. '''
  8155.         ret = libxml2mod.xmlParseAttValue(self._o)
  8156.         return ret
  8157.  
  8158.     
  8159.     def parseAttributeListDecl(self):
  8160.         """: parse the Attribute list def for an element  [52]
  8161.           AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'  [53]
  8162.            AttDef ::= S Name S AttType S DefaultDecl """
  8163.         libxml2mod.xmlParseAttributeListDecl(self._o)
  8164.  
  8165.     
  8166.     def parseCDSect(self):
  8167.         """Parse escaped pure raw content.  [18] CDSect ::= CDStart
  8168.           CData CDEnd  [19] CDStart ::= '<![CDATA['  [20] Data ::=
  8169.            (Char* - (Char* ']]>' Char*))  [21] CDEnd ::= ']]>' """
  8170.         libxml2mod.xmlParseCDSect(self._o)
  8171.  
  8172.     
  8173.     def parseCharData(self, cdata):
  8174.         '''parse a CharData section. if we are within a CDATA section
  8175.           \']]>\' marks an end of section.  The right angle bracket (>)
  8176.           may be represented using the string ">", and must, for
  8177.           compatibility, be escaped using ">" or a character
  8178.           reference when it appears in the string "]]>" in content,
  8179.           when that string is not marking the end of a CDATA section.
  8180.             [14] CharData ::= [^<&]* - ([^<&]* \']]>\' [^<&]*) '''
  8181.         libxml2mod.xmlParseCharData(self._o, cdata)
  8182.  
  8183.     
  8184.     def parseCharRef(self):
  8185.         """parse Reference declarations  [66] CharRef ::= '&#' [0-9]+
  8186.           ';' | '&#x' [0-9a-fA-F]+ ';'  [ WFC: Legal Character ]
  8187.           Characters referred to using character references must
  8188.            match the production for Char. """
  8189.         ret = libxml2mod.xmlParseCharRef(self._o)
  8190.         return ret
  8191.  
  8192.     
  8193.     def parseComment(self):
  8194.         '''Skip an XML (SGML) comment <!-- .... --> The spec says that
  8195.           "For compatibility, the string "--" (double-hyphen) must
  8196.           not occur within comments. "  [15] Comment ::= \'<!--\'
  8197.            ((Char - \'-\') | (\'-\' (Char - \'-\')))* \'-->\' '''
  8198.         libxml2mod.xmlParseComment(self._o)
  8199.  
  8200.     
  8201.     def parseContent(self):
  8202.         '''Parse a content:  [43] content ::= (element | CharData |
  8203.            Reference | CDSect | PI | Comment)* '''
  8204.         libxml2mod.xmlParseContent(self._o)
  8205.  
  8206.     
  8207.     def parseDocTypeDecl(self):
  8208.         """parse a DOCTYPE declaration  [28] doctypedecl ::=
  8209.           '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl |
  8210.           PEReference | S)* ']' S?)? '>'  [ VC: Root Element Type ]
  8211.           The Name in the document type declaration must match the
  8212.            element type of the root element. """
  8213.         libxml2mod.xmlParseDocTypeDecl(self._o)
  8214.  
  8215.     
  8216.     def parseElement(self):
  8217.         """parse an XML element, this is highly recursive  [39]
  8218.           element ::= EmptyElemTag | STag content ETag  [ WFC:
  8219.           Element Type Match ] The Name in an element's end-tag must
  8220.            match the element type in the start-tag. """
  8221.         libxml2mod.xmlParseElement(self._o)
  8222.  
  8223.     
  8224.     def parseElementDecl(self):
  8225.         """parse an Element declaration.  [45] elementdecl ::=
  8226.           '<!ELEMENT' S Name S contentspec S? '>'  [ VC: Unique
  8227.           Element Type Declaration ] No element type may be declared
  8228.            more than once """
  8229.         ret = libxml2mod.xmlParseElementDecl(self._o)
  8230.         return ret
  8231.  
  8232.     
  8233.     def parseEncName(self):
  8234.         """parse the XML encoding name  [81] EncName ::= [A-Za-z]
  8235.            ([A-Za-z0-9._] | '-')* """
  8236.         ret = libxml2mod.xmlParseEncName(self._o)
  8237.         return ret
  8238.  
  8239.     
  8240.     def parseEncodingDecl(self):
  8241.         '''parse the XML encoding declaration  [80] EncodingDecl ::= S
  8242.           \'encoding\' Eq (\'"\' EncName \'"\' |  "\'" EncName "\'")  this
  8243.            setups the conversion filters. '''
  8244.         ret = libxml2mod.xmlParseEncodingDecl(self._o)
  8245.         return ret
  8246.  
  8247.     
  8248.     def parseEndTag(self):
  8249.         """parse an end of tag  [42] ETag ::= '</' Name S? '>'  With
  8250.            namespace  [NS 9] ETag ::= '</' QName S? '>' """
  8251.         libxml2mod.xmlParseEndTag(self._o)
  8252.  
  8253.     
  8254.     def parseEntityDecl(self):
  8255.         """parse <!ENTITY declarations  [70] EntityDecl ::= GEDecl |
  8256.           PEDecl  [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S?
  8257.           '>'  [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
  8258.           [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) 
  8259.           [74] PEDef ::= EntityValue | ExternalID  [76] NDataDecl ::=
  8260.           S 'NDATA' S Name  [ VC: Notation Declared ] The Name must
  8261.            match the declared name of a notation. """
  8262.         libxml2mod.xmlParseEntityDecl(self._o)
  8263.  
  8264.     
  8265.     def parseEntityRef(self):
  8266.         '''parse ENTITY references declarations  [68] EntityRef ::=
  8267.           \'&\' Name \';\'  [ WFC: Entity Declared ] In a document
  8268.           without any DTD, a document with only an internal DTD
  8269.           subset which contains no parameter entity references, or a
  8270.           document with "standalone=\'yes\'", the Name given in the
  8271.           entity reference must match that in an entity declaration,
  8272.           except that well-formed documents need not declare any of
  8273.           the following entities: amp, lt, gt, apos, quot.  The
  8274.           declaration of a parameter entity must precede any
  8275.           reference to it.  Similarly, the declaration of a general
  8276.           entity must precede any reference to it which appears in a
  8277.           default value in an attribute-list declaration. Note that
  8278.           if entities are declared in the external subset or in
  8279.           external parameter entities, a non-validating processor is
  8280.           not obligated to read and process their declarations; for
  8281.           such documents, the rule that an entity must be declared is
  8282.           a well-formedness constraint only if standalone=\'yes\'.  [
  8283.           WFC: Parsed Entity ] An entity reference must not contain
  8284.            the name of an unparsed entity '''
  8285.         ret = libxml2mod.xmlParseEntityRef(self._o)
  8286.         if ret is None:
  8287.             raise parserError('xmlParseEntityRef() failed')
  8288.         ret is None
  8289.         _parserCtxt__tmp = xmlEntity(_obj = ret)
  8290.         return _parserCtxt__tmp
  8291.  
  8292.     
  8293.     def parseExternalSubset(self, ExternalID, SystemID):
  8294.         '''parse Markup declarations from an external subset  [30]
  8295.           extSubset ::= textDecl? extSubsetDecl  [31] extSubsetDecl
  8296.            ::= (markupdecl | conditionalSect | PEReference | S) * '''
  8297.         libxml2mod.xmlParseExternalSubset(self._o, ExternalID, SystemID)
  8298.  
  8299.     
  8300.     def parseMarkupDecl(self):
  8301.         '''parse Markup declarations  [29] markupdecl ::= elementdecl
  8302.           | AttlistDecl | EntityDecl | NotationDecl | PI | Comment  [
  8303.           VC: Proper Declaration/PE Nesting ] Parameter-entity
  8304.           replacement text must be properly nested with markup
  8305.           declarations. That is to say, if either the first character
  8306.           or the last character of a markup declaration (markupdecl
  8307.           above) is contained in the replacement text for a
  8308.           parameter-entity reference, both must be contained in the
  8309.           same replacement text.  [ WFC: PEs in Internal Subset ] In
  8310.           the internal DTD subset, parameter-entity references can
  8311.           occur only where markup declarations can occur, not within
  8312.           markup declarations. (This does not apply to references
  8313.           that occur in external parameter entities or to the
  8314.            external subset.) '''
  8315.         libxml2mod.xmlParseMarkupDecl(self._o)
  8316.  
  8317.     
  8318.     def parseMisc(self):
  8319.         '''parse an XML Misc* optional field.  [27] Misc ::= Comment |
  8320.            PI |  S '''
  8321.         libxml2mod.xmlParseMisc(self._o)
  8322.  
  8323.     
  8324.     def parseName(self):
  8325.         """parse an XML name.  [4] NameChar ::= Letter | Digit | '.' |
  8326.           '-' | '_' | ':' | CombiningChar | Extender  [5] Name ::=
  8327.           (Letter | '_' | ':') (NameChar)*  [6] Names ::= Name (#x20
  8328.            Name)* """
  8329.         ret = libxml2mod.xmlParseName(self._o)
  8330.         return ret
  8331.  
  8332.     
  8333.     def parseNamespace(self):
  8334.         """xmlParseNamespace: parse specific PI '<?namespace ...'
  8335.           constructs.  This is what the older xml-name Working Draft
  8336.           specified, a bunch of other stuff may still rely on it, so
  8337.           support is still here as if it was declared on the root of
  8338.           the Tree:-(  TODO: remove from library  To be removed at
  8339.            next drop of binary compatibility """
  8340.         libxml2mod.xmlParseNamespace(self._o)
  8341.  
  8342.     
  8343.     def parseNmtoken(self):
  8344.         '''parse an XML Nmtoken.  [7] Nmtoken ::= (NameChar)+  [8]
  8345.            Nmtokens ::= Nmtoken (#x20 Nmtoken)* '''
  8346.         ret = libxml2mod.xmlParseNmtoken(self._o)
  8347.         return ret
  8348.  
  8349.     
  8350.     def parseNotationDecl(self):
  8351.         """parse a notation declaration  [82] NotationDecl ::=
  8352.           '<!NOTATION' S Name S (ExternalID |  PublicID) S? '>' 
  8353.           Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral
  8354.           'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S
  8355.            SystemLiteral  See the NOTE on xmlParseExternalID(). """
  8356.         libxml2mod.xmlParseNotationDecl(self._o)
  8357.  
  8358.     
  8359.     def parsePEReference(self):
  8360.         '''parse PEReference declarations The entity content is
  8361.           handled directly by pushing it\'s content as a new input
  8362.           stream.  [69] PEReference ::= \'%\' Name \';\'  [ WFC: No
  8363.           Recursion ] A parsed entity must not contain a recursive
  8364.           reference to itself, either directly or indirectly.  [ WFC:
  8365.           Entity Declared ] In a document without any DTD, a document
  8366.           with only an internal DTD subset which contains no
  8367.           parameter entity references, or a document with
  8368.           "standalone=\'yes\'", ...  ... The declaration of a parameter
  8369.           entity must precede any reference to it...  [ VC: Entity
  8370.           Declared ] In a document with an external subset or
  8371.           external parameter entities with "standalone=\'no\'", ... 
  8372.           ... The declaration of a parameter entity must precede any
  8373.           reference to it...  [ WFC: In DTD ] Parameter-entity
  8374.           references may only appear in the DTD. NOTE: misleading but
  8375.            this is handled. '''
  8376.         libxml2mod.xmlParsePEReference(self._o)
  8377.  
  8378.     
  8379.     def parsePI(self):
  8380.         """parse an XML Processing Instruction.  [16] PI ::= '<?'
  8381.           PITarget (S (Char* - (Char* '?>' Char*)))? '?>'  The
  8382.            processing is transfered to SAX once parsed. """
  8383.         libxml2mod.xmlParsePI(self._o)
  8384.  
  8385.     
  8386.     def parsePITarget(self):
  8387.         """parse the name of a PI  [17] PITarget ::= Name - (('X' |
  8388.            'x') ('M' | 'm') ('L' | 'l')) """
  8389.         ret = libxml2mod.xmlParsePITarget(self._o)
  8390.         return ret
  8391.  
  8392.     
  8393.     def parsePubidLiteral(self):
  8394.         '''parse an XML public literal  [12] PubidLiteral ::= \'"\'
  8395.            PubidChar* \'"\' | "\'" (PubidChar - "\'")* "\'" '''
  8396.         ret = libxml2mod.xmlParsePubidLiteral(self._o)
  8397.         return ret
  8398.  
  8399.     
  8400.     def parseQuotedString(self):
  8401.         '''Parse and return a string between quotes or doublequotes 
  8402.           TODO: Deprecated, to  be removed at next drop of binary
  8403.            compatibility '''
  8404.         ret = libxml2mod.xmlParseQuotedString(self._o)
  8405.         return ret
  8406.  
  8407.     
  8408.     def parseReference(self):
  8409.         '''parse and handle entity references in content, depending on
  8410.           the SAX interface, this may end-up in a call to character()
  8411.           if this is a CharRef, a predefined entity, if there is no
  8412.           reference() callback. or if the parser was asked to switch
  8413.            to that mode.  [67] Reference ::= EntityRef | CharRef '''
  8414.         libxml2mod.xmlParseReference(self._o)
  8415.  
  8416.     
  8417.     def parseSDDecl(self):
  8418.         '''parse the XML standalone declaration  [32] SDDecl ::= S
  8419.           \'standalone\' Eq (("\'" (\'yes\' | \'no\') "\'") | (\'"\' (\'yes\' |
  8420.           \'no\')\'"\'))  [ VC: Standalone Document Declaration ] TODO
  8421.           The standalone document declaration must have the value
  8422.           "no" if any external markup declarations contain
  8423.           declarations of: - attributes with default values, if
  8424.           elements to which these attributes apply appear in the
  8425.           document without specifications of values for these
  8426.           attributes, or - entities (other than amp, lt, gt, apos,
  8427.           quot), if references to those entities appear in the
  8428.           document, or - attributes with values subject to
  8429.           normalization, where the attribute appears in the document
  8430.           with a value which will change as a result of
  8431.           normalization, or - element types with element content, if
  8432.           white space occurs directly within any instance of those
  8433.            types. '''
  8434.         ret = libxml2mod.xmlParseSDDecl(self._o)
  8435.         return ret
  8436.  
  8437.     
  8438.     def parseStartTag(self):
  8439.         """parse a start of tag either for rule element or
  8440.           EmptyElement. In both case we don't parse the tag closing
  8441.           chars.  [40] STag ::= '<' Name (S Attribute)* S? '>'  [
  8442.           WFC: Unique Att Spec ] No attribute name may appear more
  8443.           than once in the same start-tag or empty-element tag.  [44]
  8444.           EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'  [ WFC:
  8445.           Unique Att Spec ] No attribute name may appear more than
  8446.           once in the same start-tag or empty-element tag.  With
  8447.           namespace:  [NS 8] STag ::= '<' QName (S Attribute)* S? '>'
  8448.             [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>' """
  8449.         ret = libxml2mod.xmlParseStartTag(self._o)
  8450.         return ret
  8451.  
  8452.     
  8453.     def parseSystemLiteral(self):
  8454.         '''parse an XML Literal  [11] SystemLiteral ::= (\'"\' [^"]*
  8455.            \'"\') | ("\'" [^\']* "\'") '''
  8456.         ret = libxml2mod.xmlParseSystemLiteral(self._o)
  8457.         return ret
  8458.  
  8459.     
  8460.     def parseTextDecl(self):
  8461.         """parse an XML declaration header for external entities  [77]
  8462.           TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' 
  8463.           Question: Seems that EncodingDecl is mandatory ? Is that a
  8464.            typo ? """
  8465.         libxml2mod.xmlParseTextDecl(self._o)
  8466.  
  8467.     
  8468.     def parseVersionInfo(self):
  8469.         '''parse the XML version.  [24] VersionInfo ::= S \'version\' Eq
  8470.            (\' VersionNum \' | " VersionNum ")  [25] Eq ::= S? \'=\' S? '''
  8471.         ret = libxml2mod.xmlParseVersionInfo(self._o)
  8472.         return ret
  8473.  
  8474.     
  8475.     def parseVersionNum(self):
  8476.         """parse the XML version value.  [26] VersionNum ::=
  8477.            ([a-zA-Z0-9_.:] | '-')+ """
  8478.         ret = libxml2mod.xmlParseVersionNum(self._o)
  8479.         return ret
  8480.  
  8481.     
  8482.     def parseXMLDecl(self):
  8483.         """parse an XML declaration header  [23] XMLDecl ::= '<?xml'
  8484.            VersionInfo EncodingDecl? SDDecl? S? '?>' """
  8485.         libxml2mod.xmlParseXMLDecl(self._o)
  8486.  
  8487.     
  8488.     def parserHandlePEReference(self):
  8489.         '''[69] PEReference ::= \'%\' Name \';\'  [ WFC: No Recursion ] A
  8490.           parsed entity must not contain a recursive reference to
  8491.           itself, either directly or indirectly.  [ WFC: Entity
  8492.           Declared ] In a document without any DTD, a document with
  8493.           only an internal DTD subset which contains no parameter
  8494.           entity references, or a document with "standalone=\'yes\'",
  8495.           ...  ... The declaration of a parameter entity must precede
  8496.           any reference to it...  [ VC: Entity Declared ] In a
  8497.           document with an external subset or external parameter
  8498.           entities with "standalone=\'no\'", ...  ... The declaration
  8499.           of a parameter entity must precede any reference to it... 
  8500.           [ WFC: In DTD ] Parameter-entity references may only appear
  8501.           in the DTD. NOTE: misleading but this is handled.  A
  8502.           PEReference may have been detected in the current input
  8503.           stream the handling is done accordingly to
  8504.           http://www.w3.org/TR/REC-xml#entproc i.e. - Included in
  8505.           literal in entity values - Included as Parameter Entity
  8506.            reference within DTDs '''
  8507.         libxml2mod.xmlParserHandlePEReference(self._o)
  8508.  
  8509.     
  8510.     def parserHandleReference(self):
  8511.         """TODO: Remove, now deprecated ... the test is done directly
  8512.           in the content parsing routines.  [67] Reference ::=
  8513.           EntityRef | CharRef  [68] EntityRef ::= '&' Name ';'  [
  8514.           WFC: Entity Declared ] the Name given in the entity
  8515.           reference must match that in an entity declaration, except
  8516.           that well-formed documents need not declare any of the
  8517.           following entities: amp, lt, gt, apos, quot.  [ WFC: Parsed
  8518.           Entity ] An entity reference must not contain the name of
  8519.           an unparsed entity  [66] CharRef ::= '&#' [0-9]+ ';' |
  8520.           '&#x' [0-9a-fA-F]+ ';'  A PEReference may have been
  8521.           detected in the current input stream the handling is done
  8522.            accordingly to http://www.w3.org/TR/REC-xml#entproc """
  8523.         libxml2mod.xmlParserHandleReference(self._o)
  8524.  
  8525.     
  8526.     def popInput(self):
  8527.         '''xmlPopInput: the current input pointed by ctxt->input came
  8528.            to an end pop it and return the next char. '''
  8529.         ret = libxml2mod.xmlPopInput(self._o)
  8530.         return ret
  8531.  
  8532.     
  8533.     def scanName(self):
  8534.         """Trickery: parse an XML name but without consuming the input
  8535.           flow Needed for rollback cases. Used only when parsing
  8536.           entities references.  TODO: seems deprecated now, only used
  8537.           in the default part of xmlParserHandleReference  [4]
  8538.           NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
  8539.           CombiningChar | Extender  [5] Name ::= (Letter | '_' | ':')
  8540.            (NameChar)*  [6] Names ::= Name (S Name)* """
  8541.         ret = libxml2mod.xmlScanName(self._o)
  8542.         return ret
  8543.  
  8544.     
  8545.     def skipBlankChars(self):
  8546.         '''skip all blanks character found at that point in the input
  8547.           streams. It pops up finished entities in the process if
  8548.            allowable at that point. '''
  8549.         ret = libxml2mod.xmlSkipBlankChars(self._o)
  8550.         return ret
  8551.  
  8552.     
  8553.     def stringDecodeEntities(self, str, what, end, end2, end3):
  8554.         """Takes a entity string content and process to do the
  8555.           adequate substitutions.  [67] Reference ::= EntityRef |
  8556.            CharRef  [69] PEReference ::= '%' Name ';' """
  8557.         ret = libxml2mod.xmlStringDecodeEntities(self._o, str, what, end, end2, end3)
  8558.         return ret
  8559.  
  8560.     
  8561.     def stringLenDecodeEntities(self, str, len, what, end, end2, end3):
  8562.         """Takes a entity string content and process to do the
  8563.           adequate substitutions.  [67] Reference ::= EntityRef |
  8564.            CharRef  [69] PEReference ::= '%' Name ';' """
  8565.         ret = libxml2mod.xmlStringLenDecodeEntities(self._o, str, len, what, end, end2, end3)
  8566.         return ret
  8567.  
  8568.  
  8569.  
  8570. class xmlDtd(xmlNode):
  8571.     
  8572.     def __init__(self, _obj = None):
  8573.         if type(_obj).__name__ != 'PyCObject':
  8574.             raise TypeError, 'xmlDtd needs a PyCObject argument'
  8575.         type(_obj).__name__ != 'PyCObject'
  8576.         self._o = _obj
  8577.         xmlNode.__init__(self, _obj = _obj)
  8578.  
  8579.     
  8580.     def __repr__(self):
  8581.         return '<xmlDtd (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  8582.  
  8583.     
  8584.     def debugDumpDTD(self, output):
  8585.         '''Dumps debug information for the DTD '''
  8586.         libxml2mod.xmlDebugDumpDTD(output, self._o)
  8587.  
  8588.     
  8589.     def copyDtd(self):
  8590.         '''Do a copy of the dtd. '''
  8591.         ret = libxml2mod.xmlCopyDtd(self._o)
  8592.         if ret is None:
  8593.             raise treeError('xmlCopyDtd() failed')
  8594.         ret is None
  8595.         _xmlDtd__tmp = xmlDtd(_obj = ret)
  8596.         return _xmlDtd__tmp
  8597.  
  8598.     
  8599.     def freeDtd(self):
  8600.         '''Free a DTD structure. '''
  8601.         libxml2mod.xmlFreeDtd(self._o)
  8602.  
  8603.     
  8604.     def dtdAttrDesc(self, elem, name):
  8605.         '''Search the DTD for the description of this attribute on
  8606.            this element. '''
  8607.         ret = libxml2mod.xmlGetDtdAttrDesc(self._o, elem, name)
  8608.         if ret is None:
  8609.             raise treeError('xmlGetDtdAttrDesc() failed')
  8610.         ret is None
  8611.         _xmlDtd__tmp = xmlAttribute(_obj = ret)
  8612.         return _xmlDtd__tmp
  8613.  
  8614.     
  8615.     def dtdElementDesc(self, name):
  8616.         '''Search the DTD for the description of this element '''
  8617.         ret = libxml2mod.xmlGetDtdElementDesc(self._o, name)
  8618.         if ret is None:
  8619.             raise treeError('xmlGetDtdElementDesc() failed')
  8620.         ret is None
  8621.         _xmlDtd__tmp = xmlElement(_obj = ret)
  8622.         return _xmlDtd__tmp
  8623.  
  8624.     
  8625.     def dtdQAttrDesc(self, elem, name, prefix):
  8626.         '''Search the DTD for the description of this qualified
  8627.            attribute on this element. '''
  8628.         ret = libxml2mod.xmlGetDtdQAttrDesc(self._o, elem, name, prefix)
  8629.         if ret is None:
  8630.             raise treeError('xmlGetDtdQAttrDesc() failed')
  8631.         ret is None
  8632.         _xmlDtd__tmp = xmlAttribute(_obj = ret)
  8633.         return _xmlDtd__tmp
  8634.  
  8635.     
  8636.     def dtdQElementDesc(self, name, prefix):
  8637.         '''Search the DTD for the description of this element '''
  8638.         ret = libxml2mod.xmlGetDtdQElementDesc(self._o, name, prefix)
  8639.         if ret is None:
  8640.             raise treeError('xmlGetDtdQElementDesc() failed')
  8641.         ret is None
  8642.         _xmlDtd__tmp = xmlElement(_obj = ret)
  8643.         return _xmlDtd__tmp
  8644.  
  8645.  
  8646.  
  8647. class xmlNs(xmlNode):
  8648.     
  8649.     def __init__(self, _obj = None):
  8650.         if type(_obj).__name__ != 'PyCObject':
  8651.             raise TypeError, 'xmlNs needs a PyCObject argument'
  8652.         type(_obj).__name__ != 'PyCObject'
  8653.         self._o = _obj
  8654.         xmlNode.__init__(self, _obj = _obj)
  8655.  
  8656.     
  8657.     def __repr__(self):
  8658.         return '<xmlNs (%s) object at 0x%x>' % (self.name, long(pos_id(self)))
  8659.  
  8660.     
  8661.     def copyNamespace(self):
  8662.         '''Do a copy of the namespace. '''
  8663.         ret = libxml2mod.xmlCopyNamespace(self._o)
  8664.         if ret is None:
  8665.             raise treeError('xmlCopyNamespace() failed')
  8666.         ret is None
  8667.         _xmlNs__tmp = xmlNs(_obj = ret)
  8668.         return _xmlNs__tmp
  8669.  
  8670.     
  8671.     def copyNamespaceList(self):
  8672.         '''Do a copy of an namespace list. '''
  8673.         ret = libxml2mod.xmlCopyNamespaceList(self._o)
  8674.         if ret is None:
  8675.             raise treeError('xmlCopyNamespaceList() failed')
  8676.         ret is None
  8677.         _xmlNs__tmp = xmlNs(_obj = ret)
  8678.         return _xmlNs__tmp
  8679.  
  8680.     
  8681.     def freeNs(self):
  8682.         '''Free up the structures associated to a namespace '''
  8683.         libxml2mod.xmlFreeNs(self._o)
  8684.  
  8685.     
  8686.     def freeNsList(self):
  8687.         '''Free up all the structures associated to the chained
  8688.            namespaces. '''
  8689.         libxml2mod.xmlFreeNsList(self._o)
  8690.  
  8691.     
  8692.     def newChild(self, parent, name, content):
  8693.         '''Creation of a new child element, added at the end of
  8694.           @parent children list. @ns and @content parameters are
  8695.           optional (None). If @ns is None, the newly created element
  8696.           inherits the namespace of @parent. If @content is non None,
  8697.           a child list containing the TEXTs and ENTITY_REFs node will
  8698.           be created. NOTE: @content is supposed to be a piece of XML
  8699.           CDATA, so it allows entity references. XML special chars
  8700.           must be escaped first by using
  8701.           xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
  8702.            be used. '''
  8703.         if parent is None:
  8704.             parent__o = None
  8705.         else:
  8706.             parent__o = parent._o
  8707.         ret = libxml2mod.xmlNewChild(parent__o, self._o, name, content)
  8708.         if ret is None:
  8709.             raise treeError('xmlNewChild() failed')
  8710.         ret is None
  8711.         _xmlNs__tmp = xmlNode(_obj = ret)
  8712.         return _xmlNs__tmp
  8713.  
  8714.     
  8715.     def newDocNode(self, doc, name, content):
  8716.         """Creation of a new node element within a document. @ns and
  8717.           @content are optional (None). NOTE: @content is supposed to
  8718.           be a piece of XML CDATA, so it allow entities references,
  8719.           but XML special chars need to be escaped first by using
  8720.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  8721.            don't need entities support. """
  8722.         if doc is None:
  8723.             doc__o = None
  8724.         else:
  8725.             doc__o = doc._o
  8726.         ret = libxml2mod.xmlNewDocNode(doc__o, self._o, name, content)
  8727.         if ret is None:
  8728.             raise treeError('xmlNewDocNode() failed')
  8729.         ret is None
  8730.         _xmlNs__tmp = xmlNode(_obj = ret)
  8731.         return _xmlNs__tmp
  8732.  
  8733.     
  8734.     def newDocNodeEatName(self, doc, name, content):
  8735.         """Creation of a new node element within a document. @ns and
  8736.           @content are optional (None). NOTE: @content is supposed to
  8737.           be a piece of XML CDATA, so it allow entities references,
  8738.           but XML special chars need to be escaped first by using
  8739.           xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
  8740.            don't need entities support. """
  8741.         if doc is None:
  8742.             doc__o = None
  8743.         else:
  8744.             doc__o = doc._o
  8745.         ret = libxml2mod.xmlNewDocNodeEatName(doc__o, self._o, name, content)
  8746.         if ret is None:
  8747.             raise treeError('xmlNewDocNodeEatName() failed')
  8748.         ret is None
  8749.         _xmlNs__tmp = xmlNode(_obj = ret)
  8750.         return _xmlNs__tmp
  8751.  
  8752.     
  8753.     def newDocRawNode(self, doc, name, content):
  8754.         '''Creation of a new node element within a document. @ns and
  8755.            @content are optional (None). '''
  8756.         if doc is None:
  8757.             doc__o = None
  8758.         else:
  8759.             doc__o = doc._o
  8760.         ret = libxml2mod.xmlNewDocRawNode(doc__o, self._o, name, content)
  8761.         if ret is None:
  8762.             raise treeError('xmlNewDocRawNode() failed')
  8763.         ret is None
  8764.         _xmlNs__tmp = xmlNode(_obj = ret)
  8765.         return _xmlNs__tmp
  8766.  
  8767.     
  8768.     def newNodeEatName(self, name):
  8769.         '''Creation of a new node element. @ns is optional (None). '''
  8770.         ret = libxml2mod.xmlNewNodeEatName(self._o, name)
  8771.         if ret is None:
  8772.             raise treeError('xmlNewNodeEatName() failed')
  8773.         ret is None
  8774.         _xmlNs__tmp = xmlNode(_obj = ret)
  8775.         return _xmlNs__tmp
  8776.  
  8777.     
  8778.     def newNsProp(self, node, name, value):
  8779.         '''Create a new property tagged with a namespace and carried
  8780.            by a node. '''
  8781.         if node is None:
  8782.             node__o = None
  8783.         else:
  8784.             node__o = node._o
  8785.         ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value)
  8786.         if ret is None:
  8787.             raise treeError('xmlNewNsProp() failed')
  8788.         ret is None
  8789.         _xmlNs__tmp = xmlAttr(_obj = ret)
  8790.         return _xmlNs__tmp
  8791.  
  8792.     
  8793.     def newNsPropEatName(self, node, name, value):
  8794.         '''Create a new property tagged with a namespace and carried
  8795.            by a node. '''
  8796.         if node is None:
  8797.             node__o = None
  8798.         else:
  8799.             node__o = node._o
  8800.         ret = libxml2mod.xmlNewNsPropEatName(node__o, self._o, name, value)
  8801.         if ret is None:
  8802.             raise treeError('xmlNewNsPropEatName() failed')
  8803.         ret is None
  8804.         _xmlNs__tmp = xmlAttr(_obj = ret)
  8805.         return _xmlNs__tmp
  8806.  
  8807.     
  8808.     def newTextChild(self, parent, name, content):
  8809.         '''Creation of a new child element, added at the end of
  8810.           @parent children list. @ns and @content parameters are
  8811.           optional (None). If @ns is None, the newly created element
  8812.           inherits the namespace of @parent. If @content is non None,
  8813.           a child TEXT node will be created containing the string
  8814.           @content. NOTE: Use xmlNewChild() if @content will contain
  8815.           entities that need to be preserved. Use this function,
  8816.           xmlNewTextChild(), if you need to ensure that reserved XML
  8817.           chars that might appear in @content, such as the ampersand,
  8818.           greater-than or less-than signs, are automatically replaced
  8819.            by their XML escaped entity representations. '''
  8820.         if parent is None:
  8821.             parent__o = None
  8822.         else:
  8823.             parent__o = parent._o
  8824.         ret = libxml2mod.xmlNewTextChild(parent__o, self._o, name, content)
  8825.         if ret is None:
  8826.             raise treeError('xmlNewTextChild() failed')
  8827.         ret is None
  8828.         _xmlNs__tmp = xmlNode(_obj = ret)
  8829.         return _xmlNs__tmp
  8830.  
  8831.     
  8832.     def setNs(self, node):
  8833.         '''Associate a namespace to a node, a posteriori. '''
  8834.         if node is None:
  8835.             node__o = None
  8836.         else:
  8837.             node__o = node._o
  8838.         libxml2mod.xmlSetNs(node__o, self._o)
  8839.  
  8840.     
  8841.     def setNsProp(self, node, name, value):
  8842.         '''Set (or reset) an attribute carried by a node. The ns
  8843.            structure must be in scope, this is not checked '''
  8844.         if node is None:
  8845.             node__o = None
  8846.         else:
  8847.             node__o = node._o
  8848.         ret = libxml2mod.xmlSetNsProp(node__o, self._o, name, value)
  8849.         if ret is None:
  8850.             raise treeError('xmlSetNsProp() failed')
  8851.         ret is None
  8852.         _xmlNs__tmp = xmlAttr(_obj = ret)
  8853.         return _xmlNs__tmp
  8854.  
  8855.     
  8856.     def unsetNsProp(self, node, name):
  8857.         '''Remove an attribute carried by a node. '''
  8858.         if node is None:
  8859.             node__o = None
  8860.         else:
  8861.             node__o = node._o
  8862.         ret = libxml2mod.xmlUnsetNsProp(node__o, self._o, name)
  8863.         return ret
  8864.  
  8865.     
  8866.     def xpathNodeSetFreeNs(self):
  8867.         """Namespace nodes in libxml don't match the XPath semantic.
  8868.           In a node set the namespace nodes are duplicated and the
  8869.           next pointer is set to the parent node in the XPath
  8870.            semantic. Check if such a node needs to be freed """
  8871.         libxml2mod.xmlXPathNodeSetFreeNs(self._o)
  8872.  
  8873.  
  8874.  
  8875. class inputBuffer(ioReadWrapper):
  8876.     
  8877.     def __init__(self, _obj = None):
  8878.         self._o = _obj
  8879.         ioReadWrapper.__init__(self, _obj = _obj)
  8880.  
  8881.     
  8882.     def __del__(self):
  8883.         if self._o != None:
  8884.             libxml2mod.xmlFreeParserInputBuffer(self._o)
  8885.         
  8886.         self._o = None
  8887.  
  8888.     
  8889.     def grow(self, len):
  8890.         '''Grow up the content of the input buffer, the old data are
  8891.           preserved This routine handle the I18N transcoding to
  8892.           internal UTF-8 This routine is used when operating the
  8893.           parser in normal (pull) mode  TODO: one should be able to
  8894.           remove one extra copy by copying directly onto in->buffer
  8895.            or in->raw '''
  8896.         ret = libxml2mod.xmlParserInputBufferGrow(self._o, len)
  8897.         return ret
  8898.  
  8899.     
  8900.     def push(self, len, buf):
  8901.         '''Push the content of the arry in the input buffer This
  8902.           routine handle the I18N transcoding to internal UTF-8 This
  8903.           is used when operating the parser in progressive (push)
  8904.            mode. '''
  8905.         ret = libxml2mod.xmlParserInputBufferPush(self._o, len, buf)
  8906.         return ret
  8907.  
  8908.     
  8909.     def read(self, len):
  8910.         '''Refresh the content of the input buffer, the old data are
  8911.           considered consumed This routine handle the I18N
  8912.            transcoding to internal UTF-8 '''
  8913.         ret = libxml2mod.xmlParserInputBufferRead(self._o, len)
  8914.         return ret
  8915.  
  8916.     
  8917.     def Setup(self, reader, URL, encoding, options):
  8918.         '''Setup an XML reader with new options '''
  8919.         if reader is None:
  8920.             reader__o = None
  8921.         else:
  8922.             reader__o = reader._o
  8923.         ret = libxml2mod.xmlTextReaderSetup(reader__o, self._o, URL, encoding, options)
  8924.         return ret
  8925.  
  8926.     
  8927.     def newTextReader(self, URI):
  8928.         '''Create an xmlTextReader structure fed with @input '''
  8929.         ret = libxml2mod.xmlNewTextReader(self._o, URI)
  8930.         if ret is None:
  8931.             raise treeError('xmlNewTextReader() failed')
  8932.         ret is None
  8933.         _inputBuffer__tmp = xmlTextReader(_obj = ret)
  8934.         _inputBuffer__tmp.input = self
  8935.         return _inputBuffer__tmp
  8936.  
  8937.  
  8938.  
  8939. class relaxNgParserCtxt:
  8940.     
  8941.     def __init__(self, _obj = None):
  8942.         if _obj != None:
  8943.             self._o = _obj
  8944.             return None
  8945.         self._o = None
  8946.  
  8947.     
  8948.     def __del__(self):
  8949.         if self._o != None:
  8950.             libxml2mod.xmlRelaxNGFreeParserCtxt(self._o)
  8951.         
  8952.         self._o = None
  8953.  
  8954.     
  8955.     def relaxNGParse(self):
  8956.         '''parse a schema definition resource and build an internal
  8957.            XML Shema struture which can be used to validate instances. '''
  8958.         ret = libxml2mod.xmlRelaxNGParse(self._o)
  8959.         if ret is None:
  8960.             raise parserError('xmlRelaxNGParse() failed')
  8961.         ret is None
  8962.         _relaxNgParserCtxt__tmp = relaxNgSchema(_obj = ret)
  8963.         return _relaxNgParserCtxt__tmp
  8964.  
  8965.     
  8966.     def relaxParserSetFlag(self, flags):
  8967.         '''Semi private function used to pass informations to a parser
  8968.            context which are a combination of xmlRelaxNGParserFlag . '''
  8969.         ret = libxml2mod.xmlRelaxParserSetFlag(self._o, flags)
  8970.         return ret
  8971.  
  8972.  
  8973.  
  8974. class outputBuffer(ioWriteWrapper):
  8975.     
  8976.     def __init__(self, _obj = None):
  8977.         self._o = _obj
  8978.         ioWriteWrapper.__init__(self, _obj = _obj)
  8979.  
  8980.     
  8981.     def htmlDocContentDumpFormatOutput(self, cur, encoding, format):
  8982.         '''Dump an HTML document. '''
  8983.         if cur is None:
  8984.             cur__o = None
  8985.         else:
  8986.             cur__o = cur._o
  8987.         libxml2mod.htmlDocContentDumpFormatOutput(self._o, cur__o, encoding, format)
  8988.  
  8989.     
  8990.     def htmlDocContentDumpOutput(self, cur, encoding):
  8991.         '''Dump an HTML document. Formating return/spaces are added. '''
  8992.         if cur is None:
  8993.             cur__o = None
  8994.         else:
  8995.             cur__o = cur._o
  8996.         libxml2mod.htmlDocContentDumpOutput(self._o, cur__o, encoding)
  8997.  
  8998.     
  8999.     def htmlNodeDumpFormatOutput(self, doc, cur, encoding, format):
  9000.         '''Dump an HTML node, recursive behaviour,children are printed
  9001.            too. '''
  9002.         if doc is None:
  9003.             doc__o = None
  9004.         else:
  9005.             doc__o = doc._o
  9006.         if cur is None:
  9007.             cur__o = None
  9008.         else:
  9009.             cur__o = cur._o
  9010.         libxml2mod.htmlNodeDumpFormatOutput(self._o, doc__o, cur__o, encoding, format)
  9011.  
  9012.     
  9013.     def htmlNodeDumpOutput(self, doc, cur, encoding):
  9014.         '''Dump an HTML node, recursive behaviour,children are printed
  9015.            too, and formatting returns/spaces are added. '''
  9016.         if doc is None:
  9017.             doc__o = None
  9018.         else:
  9019.             doc__o = doc._o
  9020.         if cur is None:
  9021.             cur__o = None
  9022.         else:
  9023.             cur__o = cur._o
  9024.         libxml2mod.htmlNodeDumpOutput(self._o, doc__o, cur__o, encoding)
  9025.  
  9026.     
  9027.     def nodeDumpOutput(self, doc, cur, level, format, encoding):
  9028.         '''Dump an XML node, recursive behaviour, children are printed
  9029.           too. Note that @format = 1 provide node indenting only if
  9030.           xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
  9031.            called '''
  9032.         if doc is None:
  9033.             doc__o = None
  9034.         else:
  9035.             doc__o = doc._o
  9036.         if cur is None:
  9037.             cur__o = None
  9038.         else:
  9039.             cur__o = cur._o
  9040.         libxml2mod.xmlNodeDumpOutput(self._o, doc__o, cur__o, level, format, encoding)
  9041.  
  9042.     
  9043.     def saveFileTo(self, cur, encoding):
  9044.         '''Dump an XML document to an I/O buffer. Warning ! This call
  9045.           xmlOutputBufferClose() on buf which is not available after
  9046.            this call. '''
  9047.         if cur is None:
  9048.             cur__o = None
  9049.         else:
  9050.             cur__o = cur._o
  9051.         ret = libxml2mod.xmlSaveFileTo(self._o, cur__o, encoding)
  9052.         return ret
  9053.  
  9054.     
  9055.     def saveFormatFileTo(self, cur, encoding, format):
  9056.         '''Dump an XML document to an I/O buffer. Warning ! This call
  9057.           xmlOutputBufferClose() on buf which is not available after
  9058.            this call. '''
  9059.         if cur is None:
  9060.             cur__o = None
  9061.         else:
  9062.             cur__o = cur._o
  9063.         ret = libxml2mod.xmlSaveFormatFileTo(self._o, cur__o, encoding, format)
  9064.         return ret
  9065.  
  9066.     
  9067.     def write(self, len, buf):
  9068.         '''Write the content of the array in the output I/O buffer
  9069.           This routine handle the I18N transcoding from internal
  9070.           UTF-8 The buffer is lossless, i.e. will store in case of
  9071.            partial or delayed writes. '''
  9072.         ret = libxml2mod.xmlOutputBufferWrite(self._o, len, buf)
  9073.         return ret
  9074.  
  9075.     
  9076.     def writeString(self, str):
  9077.         '''Write the content of the string in the output I/O buffer
  9078.           This routine handle the I18N transcoding from internal
  9079.           UTF-8 The buffer is lossless, i.e. will store in case of
  9080.            partial or delayed writes. '''
  9081.         ret = libxml2mod.xmlOutputBufferWriteString(self._o, str)
  9082.         return ret
  9083.  
  9084.  
  9085.  
  9086. class SchemaParserCtxt:
  9087.     
  9088.     def __init__(self, _obj = None):
  9089.         if _obj != None:
  9090.             self._o = _obj
  9091.             return None
  9092.         self._o = None
  9093.  
  9094.     
  9095.     def __del__(self):
  9096.         if self._o != None:
  9097.             libxml2mod.xmlSchemaFreeParserCtxt(self._o)
  9098.         
  9099.         self._o = None
  9100.  
  9101.     
  9102.     def schemaParse(self):
  9103.         '''parse a schema definition resource and build an internal
  9104.            XML Shema struture which can be used to validate instances. '''
  9105.         ret = libxml2mod.xmlSchemaParse(self._o)
  9106.         if ret is None:
  9107.             raise parserError('xmlSchemaParse() failed')
  9108.         ret is None
  9109.         _SchemaParserCtxt__tmp = Schema(_obj = ret)
  9110.         return _SchemaParserCtxt__tmp
  9111.  
  9112.  
  9113.  
  9114. class SchemaValidCtxt(SchemaValidCtxtCore):
  9115.     
  9116.     def __init__(self, _obj = None):
  9117.         self.schema = None
  9118.         self._o = _obj
  9119.         SchemaValidCtxtCore.__init__(self, _obj = _obj)
  9120.  
  9121.     
  9122.     def __del__(self):
  9123.         if self._o != None:
  9124.             libxml2mod.xmlSchemaFreeValidCtxt(self._o)
  9125.         
  9126.         self._o = None
  9127.  
  9128.     
  9129.     def SchemaValidateCtxt(self, reader, options):
  9130.         '''Use W3C XSD schema context to validate the document as it
  9131.           is processed. Activation is only possible before the first
  9132.           Read(). If @ctxt is None, then XML Schema validation is
  9133.            deactivated. '''
  9134.         if reader is None:
  9135.             reader__o = None
  9136.         else:
  9137.             reader__o = reader._o
  9138.         ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(reader__o, self._o, options)
  9139.         return ret
  9140.  
  9141.     
  9142.     def schemaIsValid(self):
  9143.         ret = libxml2mod.xmlSchemaIsValid(self._o)
  9144.         return ret
  9145.  
  9146.     
  9147.     def schemaSetValidOptions(self, options):
  9148.         ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options)
  9149.         return ret
  9150.  
  9151.     
  9152.     def schemaValidCtxtGetOptions(self):
  9153.         ret = libxml2mod.xmlSchemaValidCtxtGetOptions(self._o)
  9154.         return ret
  9155.  
  9156.     
  9157.     def schemaValidateDoc(self, instance):
  9158.         if instance is None:
  9159.             instance__o = None
  9160.         else:
  9161.             instance__o = instance._o
  9162.         ret = libxml2mod.xmlSchemaValidateDoc(self._o, instance__o)
  9163.         return ret
  9164.  
  9165.     
  9166.     def schemaValidateFile(self, filename, options):
  9167.         ret = libxml2mod.xmlSchemaValidateFile(self._o, filename, options)
  9168.         return ret
  9169.  
  9170.     
  9171.     def schemaValidateOneElement(self, elem):
  9172.         if elem is None:
  9173.             elem__o = None
  9174.         else:
  9175.             elem__o = elem._o
  9176.         ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o)
  9177.         return ret
  9178.  
  9179.  
  9180.  
  9181. class xmlTextReaderLocator:
  9182.     
  9183.     def __init__(self, _obj = None):
  9184.         if _obj != None:
  9185.             self._o = _obj
  9186.             return None
  9187.         self._o = None
  9188.  
  9189.     
  9190.     def BaseURI(self):
  9191.         '''Obtain the base URI for the given locator. '''
  9192.         ret = libxml2mod.xmlTextReaderLocatorBaseURI(self._o)
  9193.         return ret
  9194.  
  9195.     
  9196.     def LineNumber(self):
  9197.         '''Obtain the line number for the given locator. '''
  9198.         ret = libxml2mod.xmlTextReaderLocatorLineNumber(self._o)
  9199.         return ret
  9200.  
  9201.  
  9202.  
  9203. class URI:
  9204.     
  9205.     def __init__(self, _obj = None):
  9206.         if _obj != None:
  9207.             self._o = _obj
  9208.             return None
  9209.         self._o = None
  9210.  
  9211.     
  9212.     def __del__(self):
  9213.         if self._o != None:
  9214.             libxml2mod.xmlFreeURI(self._o)
  9215.         
  9216.         self._o = None
  9217.  
  9218.     
  9219.     def authority(self):
  9220.         '''Get the authority part from an URI '''
  9221.         ret = libxml2mod.xmlURIGetAuthority(self._o)
  9222.         return ret
  9223.  
  9224.     
  9225.     def fragment(self):
  9226.         '''Get the fragment part from an URI '''
  9227.         ret = libxml2mod.xmlURIGetFragment(self._o)
  9228.         return ret
  9229.  
  9230.     
  9231.     def opaque(self):
  9232.         '''Get the opaque part from an URI '''
  9233.         ret = libxml2mod.xmlURIGetOpaque(self._o)
  9234.         return ret
  9235.  
  9236.     
  9237.     def path(self):
  9238.         '''Get the path part from an URI '''
  9239.         ret = libxml2mod.xmlURIGetPath(self._o)
  9240.         return ret
  9241.  
  9242.     
  9243.     def port(self):
  9244.         '''Get the port part from an URI '''
  9245.         ret = libxml2mod.xmlURIGetPort(self._o)
  9246.         return ret
  9247.  
  9248.     
  9249.     def query(self):
  9250.         '''Get the query part from an URI '''
  9251.         ret = libxml2mod.xmlURIGetQuery(self._o)
  9252.         return ret
  9253.  
  9254.     
  9255.     def queryRaw(self):
  9256.         '''Get the raw query part from an URI (i.e. the unescaped
  9257.            form). '''
  9258.         ret = libxml2mod.xmlURIGetQueryRaw(self._o)
  9259.         return ret
  9260.  
  9261.     
  9262.     def scheme(self):
  9263.         '''Get the scheme part from an URI '''
  9264.         ret = libxml2mod.xmlURIGetScheme(self._o)
  9265.         return ret
  9266.  
  9267.     
  9268.     def server(self):
  9269.         '''Get the server part from an URI '''
  9270.         ret = libxml2mod.xmlURIGetServer(self._o)
  9271.         return ret
  9272.  
  9273.     
  9274.     def setAuthority(self, authority):
  9275.         '''Set the authority part of an URI. '''
  9276.         libxml2mod.xmlURISetAuthority(self._o, authority)
  9277.  
  9278.     
  9279.     def setFragment(self, fragment):
  9280.         '''Set the fragment part of an URI. '''
  9281.         libxml2mod.xmlURISetFragment(self._o, fragment)
  9282.  
  9283.     
  9284.     def setOpaque(self, opaque):
  9285.         '''Set the opaque part of an URI. '''
  9286.         libxml2mod.xmlURISetOpaque(self._o, opaque)
  9287.  
  9288.     
  9289.     def setPath(self, path):
  9290.         '''Set the path part of an URI. '''
  9291.         libxml2mod.xmlURISetPath(self._o, path)
  9292.  
  9293.     
  9294.     def setPort(self, port):
  9295.         '''Set the port part of an URI. '''
  9296.         libxml2mod.xmlURISetPort(self._o, port)
  9297.  
  9298.     
  9299.     def setQuery(self, query):
  9300.         '''Set the query part of an URI. '''
  9301.         libxml2mod.xmlURISetQuery(self._o, query)
  9302.  
  9303.     
  9304.     def setQueryRaw(self, query_raw):
  9305.         '''Set the raw query part of an URI (i.e. the unescaped form). '''
  9306.         libxml2mod.xmlURISetQueryRaw(self._o, query_raw)
  9307.  
  9308.     
  9309.     def setScheme(self, scheme):
  9310.         '''Set the scheme part of an URI. '''
  9311.         libxml2mod.xmlURISetScheme(self._o, scheme)
  9312.  
  9313.     
  9314.     def setServer(self, server):
  9315.         '''Set the server part of an URI. '''
  9316.         libxml2mod.xmlURISetServer(self._o, server)
  9317.  
  9318.     
  9319.     def setUser(self, user):
  9320.         '''Set the user part of an URI. '''
  9321.         libxml2mod.xmlURISetUser(self._o, user)
  9322.  
  9323.     
  9324.     def user(self):
  9325.         '''Get the user part from an URI '''
  9326.         ret = libxml2mod.xmlURIGetUser(self._o)
  9327.         return ret
  9328.  
  9329.     
  9330.     def parseURIReference(self, str):
  9331.         '''Parse an URI reference string and fills in the appropriate
  9332.           fields of the @uri structure  URI-reference = [ absoluteURI
  9333.            | relativeURI ] [ "#" fragment ] '''
  9334.         ret = libxml2mod.xmlParseURIReference(self._o, str)
  9335.         return ret
  9336.  
  9337.     
  9338.     def printURI(self, stream):
  9339.         '''Prints the URI in the stream @stream. '''
  9340.         libxml2mod.xmlPrintURI(stream, self._o)
  9341.  
  9342.     
  9343.     def saveUri(self):
  9344.         '''Save the URI as an escaped string '''
  9345.         ret = libxml2mod.xmlSaveUri(self._o)
  9346.         return ret
  9347.  
  9348.  
  9349. XLINK_SHOW_NONE = 0
  9350. XLINK_SHOW_NEW = 1
  9351. XLINK_SHOW_EMBED = 2
  9352. XLINK_SHOW_REPLACE = 3
  9353. XML_RELAXNGP_NONE = 0
  9354. XML_RELAXNGP_FREE_DOC = 1
  9355. XML_RELAXNGP_CRNG = 2
  9356. XML_BUFFER_ALLOC_DOUBLEIT = 1
  9357. XML_BUFFER_ALLOC_EXACT = 2
  9358. XML_BUFFER_ALLOC_IMMUTABLE = 3
  9359. XML_PARSER_SEVERITY_VALIDITY_WARNING = 1
  9360. XML_PARSER_SEVERITY_VALIDITY_ERROR = 2
  9361. XML_PARSER_SEVERITY_WARNING = 3
  9362. XML_PARSER_SEVERITY_ERROR = 4
  9363. XML_ATTRIBUTE_NONE = 1
  9364. XML_ATTRIBUTE_REQUIRED = 2
  9365. XML_ATTRIBUTE_IMPLIED = 3
  9366. XML_ATTRIBUTE_FIXED = 4
  9367. XML_SCHEMAS_UNKNOWN = 0
  9368. XML_SCHEMAS_STRING = 1
  9369. XML_SCHEMAS_NORMSTRING = 2
  9370. XML_SCHEMAS_DECIMAL = 3
  9371. XML_SCHEMAS_TIME = 4
  9372. XML_SCHEMAS_GDAY = 5
  9373. XML_SCHEMAS_GMONTH = 6
  9374. XML_SCHEMAS_GMONTHDAY = 7
  9375. XML_SCHEMAS_GYEAR = 8
  9376. XML_SCHEMAS_GYEARMONTH = 9
  9377. XML_SCHEMAS_DATE = 10
  9378. XML_SCHEMAS_DATETIME = 11
  9379. XML_SCHEMAS_DURATION = 12
  9380. XML_SCHEMAS_FLOAT = 13
  9381. XML_SCHEMAS_DOUBLE = 14
  9382. XML_SCHEMAS_BOOLEAN = 15
  9383. XML_SCHEMAS_TOKEN = 16
  9384. XML_SCHEMAS_LANGUAGE = 17
  9385. XML_SCHEMAS_NMTOKEN = 18
  9386. XML_SCHEMAS_NMTOKENS = 19
  9387. XML_SCHEMAS_NAME = 20
  9388. XML_SCHEMAS_QNAME = 21
  9389. XML_SCHEMAS_NCNAME = 22
  9390. XML_SCHEMAS_ID = 23
  9391. XML_SCHEMAS_IDREF = 24
  9392. XML_SCHEMAS_IDREFS = 25
  9393. XML_SCHEMAS_ENTITY = 26
  9394. XML_SCHEMAS_ENTITIES = 27
  9395. XML_SCHEMAS_NOTATION = 28
  9396. XML_SCHEMAS_ANYURI = 29
  9397. XML_SCHEMAS_INTEGER = 30
  9398. XML_SCHEMAS_NPINTEGER = 31
  9399. XML_SCHEMAS_NINTEGER = 32
  9400. XML_SCHEMAS_NNINTEGER = 33
  9401. XML_SCHEMAS_PINTEGER = 34
  9402. XML_SCHEMAS_INT = 35
  9403. XML_SCHEMAS_UINT = 36
  9404. XML_SCHEMAS_LONG = 37
  9405. XML_SCHEMAS_ULONG = 38
  9406. XML_SCHEMAS_SHORT = 39
  9407. XML_SCHEMAS_USHORT = 40
  9408. XML_SCHEMAS_BYTE = 41
  9409. XML_SCHEMAS_UBYTE = 42
  9410. XML_SCHEMAS_HEXBINARY = 43
  9411. XML_SCHEMAS_BASE64BINARY = 44
  9412. XML_SCHEMAS_ANYTYPE = 45
  9413. XML_SCHEMAS_ANYSIMPLETYPE = 46
  9414. XML_PARSER_EOF = -1
  9415. XML_PARSER_START = 0
  9416. XML_PARSER_MISC = 1
  9417. XML_PARSER_PI = 2
  9418. XML_PARSER_DTD = 3
  9419. XML_PARSER_PROLOG = 4
  9420. XML_PARSER_COMMENT = 5
  9421. XML_PARSER_START_TAG = 6
  9422. XML_PARSER_CONTENT = 7
  9423. XML_PARSER_CDATA_SECTION = 8
  9424. XML_PARSER_END_TAG = 9
  9425. XML_PARSER_ENTITY_DECL = 10
  9426. XML_PARSER_ENTITY_VALUE = 11
  9427. XML_PARSER_ATTRIBUTE_VALUE = 12
  9428. XML_PARSER_SYSTEM_LITERAL = 13
  9429. XML_PARSER_EPILOG = 14
  9430. XML_PARSER_IGNORE = 15
  9431. XML_PARSER_PUBLIC_LITERAL = 16
  9432. XML_INTERNAL_GENERAL_ENTITY = 1
  9433. XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2
  9434. XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3
  9435. XML_INTERNAL_PARAMETER_ENTITY = 4
  9436. XML_EXTERNAL_PARAMETER_ENTITY = 5
  9437. XML_INTERNAL_PREDEFINED_ENTITY = 6
  9438. XML_SAVE_FORMAT = 1
  9439. XML_SAVE_NO_DECL = 2
  9440. XML_SAVE_NO_EMPTY = 4
  9441. XML_SAVE_NO_XHTML = 8
  9442. XML_PATTERN_DEFAULT = 0
  9443. XML_PATTERN_XPATH = 1
  9444. XML_PATTERN_XSSEL = 2
  9445. XML_PATTERN_XSFIELD = 4
  9446. XML_ERR_OK = 0
  9447. XML_ERR_INTERNAL_ERROR = 1
  9448. XML_ERR_NO_MEMORY = 2
  9449. XML_ERR_DOCUMENT_START = 3
  9450. XML_ERR_DOCUMENT_EMPTY = 4
  9451. XML_ERR_DOCUMENT_END = 5
  9452. XML_ERR_INVALID_HEX_CHARREF = 6
  9453. XML_ERR_INVALID_DEC_CHARREF = 7
  9454. XML_ERR_INVALID_CHARREF = 8
  9455. XML_ERR_INVALID_CHAR = 9
  9456. XML_ERR_CHARREF_AT_EOF = 10
  9457. XML_ERR_CHARREF_IN_PROLOG = 11
  9458. XML_ERR_CHARREF_IN_EPILOG = 12
  9459. XML_ERR_CHARREF_IN_DTD = 13
  9460. XML_ERR_ENTITYREF_AT_EOF = 14
  9461. XML_ERR_ENTITYREF_IN_PROLOG = 15
  9462. XML_ERR_ENTITYREF_IN_EPILOG = 16
  9463. XML_ERR_ENTITYREF_IN_DTD = 17
  9464. XML_ERR_PEREF_AT_EOF = 18
  9465. XML_ERR_PEREF_IN_PROLOG = 19
  9466. XML_ERR_PEREF_IN_EPILOG = 20
  9467. XML_ERR_PEREF_IN_INT_SUBSET = 21
  9468. XML_ERR_ENTITYREF_NO_NAME = 22
  9469. XML_ERR_ENTITYREF_SEMICOL_MISSING = 23
  9470. XML_ERR_PEREF_NO_NAME = 24
  9471. XML_ERR_PEREF_SEMICOL_MISSING = 25
  9472. XML_ERR_UNDECLARED_ENTITY = 26
  9473. XML_WAR_UNDECLARED_ENTITY = 27
  9474. XML_ERR_UNPARSED_ENTITY = 28
  9475. XML_ERR_ENTITY_IS_EXTERNAL = 29
  9476. XML_ERR_ENTITY_IS_PARAMETER = 30
  9477. XML_ERR_UNKNOWN_ENCODING = 31
  9478. XML_ERR_UNSUPPORTED_ENCODING = 32
  9479. XML_ERR_STRING_NOT_STARTED = 33
  9480. XML_ERR_STRING_NOT_CLOSED = 34
  9481. XML_ERR_NS_DECL_ERROR = 35
  9482. XML_ERR_ENTITY_NOT_STARTED = 36
  9483. XML_ERR_ENTITY_NOT_FINISHED = 37
  9484. XML_ERR_LT_IN_ATTRIBUTE = 38
  9485. XML_ERR_ATTRIBUTE_NOT_STARTED = 39
  9486. XML_ERR_ATTRIBUTE_NOT_FINISHED = 40
  9487. XML_ERR_ATTRIBUTE_WITHOUT_VALUE = 41
  9488. XML_ERR_ATTRIBUTE_REDEFINED = 42
  9489. XML_ERR_LITERAL_NOT_STARTED = 43
  9490. XML_ERR_LITERAL_NOT_FINISHED = 44
  9491. XML_ERR_COMMENT_NOT_FINISHED = 45
  9492. XML_ERR_PI_NOT_STARTED = 46
  9493. XML_ERR_PI_NOT_FINISHED = 47
  9494. XML_ERR_NOTATION_NOT_STARTED = 48
  9495. XML_ERR_NOTATION_NOT_FINISHED = 49
  9496. XML_ERR_ATTLIST_NOT_STARTED = 50
  9497. XML_ERR_ATTLIST_NOT_FINISHED = 51
  9498. XML_ERR_MIXED_NOT_STARTED = 52
  9499. XML_ERR_MIXED_NOT_FINISHED = 53
  9500. XML_ERR_ELEMCONTENT_NOT_STARTED = 54
  9501. XML_ERR_ELEMCONTENT_NOT_FINISHED = 55
  9502. XML_ERR_XMLDECL_NOT_STARTED = 56
  9503. XML_ERR_XMLDECL_NOT_FINISHED = 57
  9504. XML_ERR_CONDSEC_NOT_STARTED = 58
  9505. XML_ERR_CONDSEC_NOT_FINISHED = 59
  9506. XML_ERR_EXT_SUBSET_NOT_FINISHED = 60
  9507. XML_ERR_DOCTYPE_NOT_FINISHED = 61
  9508. XML_ERR_MISPLACED_CDATA_END = 62
  9509. XML_ERR_CDATA_NOT_FINISHED = 63
  9510. XML_ERR_RESERVED_XML_NAME = 64
  9511. XML_ERR_SPACE_REQUIRED = 65
  9512. XML_ERR_SEPARATOR_REQUIRED = 66
  9513. XML_ERR_NMTOKEN_REQUIRED = 67
  9514. XML_ERR_NAME_REQUIRED = 68
  9515. XML_ERR_PCDATA_REQUIRED = 69
  9516. XML_ERR_URI_REQUIRED = 70
  9517. XML_ERR_PUBID_REQUIRED = 71
  9518. XML_ERR_LT_REQUIRED = 72
  9519. XML_ERR_GT_REQUIRED = 73
  9520. XML_ERR_LTSLASH_REQUIRED = 74
  9521. XML_ERR_EQUAL_REQUIRED = 75
  9522. XML_ERR_TAG_NAME_MISMATCH = 76
  9523. XML_ERR_TAG_NOT_FINISHED = 77
  9524. XML_ERR_STANDALONE_VALUE = 78
  9525. XML_ERR_ENCODING_NAME = 79
  9526. XML_ERR_HYPHEN_IN_COMMENT = 80
  9527. XML_ERR_INVALID_ENCODING = 81
  9528. XML_ERR_EXT_ENTITY_STANDALONE = 82
  9529. XML_ERR_CONDSEC_INVALID = 83
  9530. XML_ERR_VALUE_REQUIRED = 84
  9531. XML_ERR_NOT_WELL_BALANCED = 85
  9532. XML_ERR_EXTRA_CONTENT = 86
  9533. XML_ERR_ENTITY_CHAR_ERROR = 87
  9534. XML_ERR_ENTITY_PE_INTERNAL = 88
  9535. XML_ERR_ENTITY_LOOP = 89
  9536. XML_ERR_ENTITY_BOUNDARY = 90
  9537. XML_ERR_INVALID_URI = 91
  9538. XML_ERR_URI_FRAGMENT = 92
  9539. XML_WAR_CATALOG_PI = 93
  9540. XML_ERR_NO_DTD = 94
  9541. XML_ERR_CONDSEC_INVALID_KEYWORD = 95
  9542. XML_ERR_VERSION_MISSING = 96
  9543. XML_WAR_UNKNOWN_VERSION = 97
  9544. XML_WAR_LANG_VALUE = 98
  9545. XML_WAR_NS_URI = 99
  9546. XML_WAR_NS_URI_RELATIVE = 100
  9547. XML_ERR_MISSING_ENCODING = 101
  9548. XML_WAR_SPACE_VALUE = 102
  9549. XML_ERR_NOT_STANDALONE = 103
  9550. XML_ERR_ENTITY_PROCESSING = 104
  9551. XML_ERR_NOTATION_PROCESSING = 105
  9552. XML_WAR_NS_COLUMN = 106
  9553. XML_WAR_ENTITY_REDEFINED = 107
  9554. XML_NS_ERR_XML_NAMESPACE = 200
  9555. XML_NS_ERR_UNDEFINED_NAMESPACE = 201
  9556. XML_NS_ERR_QNAME = 202
  9557. XML_NS_ERR_ATTRIBUTE_REDEFINED = 203
  9558. XML_NS_ERR_EMPTY = 204
  9559. XML_DTD_ATTRIBUTE_DEFAULT = 500
  9560. XML_DTD_ATTRIBUTE_REDEFINED = 501
  9561. XML_DTD_ATTRIBUTE_VALUE = 502
  9562. XML_DTD_CONTENT_ERROR = 503
  9563. XML_DTD_CONTENT_MODEL = 504
  9564. XML_DTD_CONTENT_NOT_DETERMINIST = 505
  9565. XML_DTD_DIFFERENT_PREFIX = 506
  9566. XML_DTD_ELEM_DEFAULT_NAMESPACE = 507
  9567. XML_DTD_ELEM_NAMESPACE = 508
  9568. XML_DTD_ELEM_REDEFINED = 509
  9569. XML_DTD_EMPTY_NOTATION = 510
  9570. XML_DTD_ENTITY_TYPE = 511
  9571. XML_DTD_ID_FIXED = 512
  9572. XML_DTD_ID_REDEFINED = 513
  9573. XML_DTD_ID_SUBSET = 514
  9574. XML_DTD_INVALID_CHILD = 515
  9575. XML_DTD_INVALID_DEFAULT = 516
  9576. XML_DTD_LOAD_ERROR = 517
  9577. XML_DTD_MISSING_ATTRIBUTE = 518
  9578. XML_DTD_MIXED_CORRUPT = 519
  9579. XML_DTD_MULTIPLE_ID = 520
  9580. XML_DTD_NO_DOC = 521
  9581. XML_DTD_NO_DTD = 522
  9582. XML_DTD_NO_ELEM_NAME = 523
  9583. XML_DTD_NO_PREFIX = 524
  9584. XML_DTD_NO_ROOT = 525
  9585. XML_DTD_NOTATION_REDEFINED = 526
  9586. XML_DTD_NOTATION_VALUE = 527
  9587. XML_DTD_NOT_EMPTY = 528
  9588. XML_DTD_NOT_PCDATA = 529
  9589. XML_DTD_NOT_STANDALONE = 530
  9590. XML_DTD_ROOT_NAME = 531
  9591. XML_DTD_STANDALONE_WHITE_SPACE = 532
  9592. XML_DTD_UNKNOWN_ATTRIBUTE = 533
  9593. XML_DTD_UNKNOWN_ELEM = 534
  9594. XML_DTD_UNKNOWN_ENTITY = 535
  9595. XML_DTD_UNKNOWN_ID = 536
  9596. XML_DTD_UNKNOWN_NOTATION = 537
  9597. XML_DTD_STANDALONE_DEFAULTED = 538
  9598. XML_DTD_XMLID_VALUE = 539
  9599. XML_DTD_XMLID_TYPE = 540
  9600. XML_HTML_STRUCURE_ERROR = 800
  9601. XML_HTML_UNKNOWN_TAG = 801
  9602. XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000
  9603. XML_RNGP_ATTR_CONFLICT = 1001
  9604. XML_RNGP_ATTRIBUTE_CHILDREN = 1002
  9605. XML_RNGP_ATTRIBUTE_CONTENT = 1003
  9606. XML_RNGP_ATTRIBUTE_EMPTY = 1004
  9607. XML_RNGP_ATTRIBUTE_NOOP = 1005
  9608. XML_RNGP_CHOICE_CONTENT = 1006
  9609. XML_RNGP_CHOICE_EMPTY = 1007
  9610. XML_RNGP_CREATE_FAILURE = 1008
  9611. XML_RNGP_DATA_CONTENT = 1009
  9612. XML_RNGP_DEF_CHOICE_AND_INTERLEAVE = 1010
  9613. XML_RNGP_DEFINE_CREATE_FAILED = 1011
  9614. XML_RNGP_DEFINE_EMPTY = 1012
  9615. XML_RNGP_DEFINE_MISSING = 1013
  9616. XML_RNGP_DEFINE_NAME_MISSING = 1014
  9617. XML_RNGP_ELEM_CONTENT_EMPTY = 1015
  9618. XML_RNGP_ELEM_CONTENT_ERROR = 1016
  9619. XML_RNGP_ELEMENT_EMPTY = 1017
  9620. XML_RNGP_ELEMENT_CONTENT = 1018
  9621. XML_RNGP_ELEMENT_NAME = 1019
  9622. XML_RNGP_ELEMENT_NO_CONTENT = 1020
  9623. XML_RNGP_ELEM_TEXT_CONFLICT = 1021
  9624. XML_RNGP_EMPTY = 1022
  9625. XML_RNGP_EMPTY_CONSTRUCT = 1023
  9626. XML_RNGP_EMPTY_CONTENT = 1024
  9627. XML_RNGP_EMPTY_NOT_EMPTY = 1025
  9628. XML_RNGP_ERROR_TYPE_LIB = 1026
  9629. XML_RNGP_EXCEPT_EMPTY = 1027
  9630. XML_RNGP_EXCEPT_MISSING = 1028
  9631. XML_RNGP_EXCEPT_MULTIPLE = 1029
  9632. XML_RNGP_EXCEPT_NO_CONTENT = 1030
  9633. XML_RNGP_EXTERNALREF_EMTPY = 1031
  9634. XML_RNGP_EXTERNAL_REF_FAILURE = 1032
  9635. XML_RNGP_EXTERNALREF_RECURSE = 1033
  9636. XML_RNGP_FORBIDDEN_ATTRIBUTE = 1034
  9637. XML_RNGP_FOREIGN_ELEMENT = 1035
  9638. XML_RNGP_GRAMMAR_CONTENT = 1036
  9639. XML_RNGP_GRAMMAR_EMPTY = 1037
  9640. XML_RNGP_GRAMMAR_MISSING = 1038
  9641. XML_RNGP_GRAMMAR_NO_START = 1039
  9642. XML_RNGP_GROUP_ATTR_CONFLICT = 1040
  9643. XML_RNGP_HREF_ERROR = 1041
  9644. XML_RNGP_INCLUDE_EMPTY = 1042
  9645. XML_RNGP_INCLUDE_FAILURE = 1043
  9646. XML_RNGP_INCLUDE_RECURSE = 1044
  9647. XML_RNGP_INTERLEAVE_ADD = 1045
  9648. XML_RNGP_INTERLEAVE_CREATE_FAILED = 1046
  9649. XML_RNGP_INTERLEAVE_EMPTY = 1047
  9650. XML_RNGP_INTERLEAVE_NO_CONTENT = 1048
  9651. XML_RNGP_INVALID_DEFINE_NAME = 1049
  9652. XML_RNGP_INVALID_URI = 1050
  9653. XML_RNGP_INVALID_VALUE = 1051
  9654. XML_RNGP_MISSING_HREF = 1052
  9655. XML_RNGP_NAME_MISSING = 1053
  9656. XML_RNGP_NEED_COMBINE = 1054
  9657. XML_RNGP_NOTALLOWED_NOT_EMPTY = 1055
  9658. XML_RNGP_NSNAME_ATTR_ANCESTOR = 1056
  9659. XML_RNGP_NSNAME_NO_NS = 1057
  9660. XML_RNGP_PARAM_FORBIDDEN = 1058
  9661. XML_RNGP_PARAM_NAME_MISSING = 1059
  9662. XML_RNGP_PARENTREF_CREATE_FAILED = 1060
  9663. XML_RNGP_PARENTREF_NAME_INVALID = 1061
  9664. XML_RNGP_PARENTREF_NO_NAME = 1062
  9665. XML_RNGP_PARENTREF_NO_PARENT = 1063
  9666. XML_RNGP_PARENTREF_NOT_EMPTY = 1064
  9667. XML_RNGP_PARSE_ERROR = 1065
  9668. XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME = 1066
  9669. XML_RNGP_PAT_ATTR_ATTR = 1067
  9670. XML_RNGP_PAT_ATTR_ELEM = 1068
  9671. XML_RNGP_PAT_DATA_EXCEPT_ATTR = 1069
  9672. XML_RNGP_PAT_DATA_EXCEPT_ELEM = 1070
  9673. XML_RNGP_PAT_DATA_EXCEPT_EMPTY = 1071
  9674. XML_RNGP_PAT_DATA_EXCEPT_GROUP = 1072
  9675. XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE = 1073
  9676. XML_RNGP_PAT_DATA_EXCEPT_LIST = 1074
  9677. XML_RNGP_PAT_DATA_EXCEPT_ONEMORE = 1075
  9678. XML_RNGP_PAT_DATA_EXCEPT_REF = 1076
  9679. XML_RNGP_PAT_DATA_EXCEPT_TEXT = 1077
  9680. XML_RNGP_PAT_LIST_ATTR = 1078
  9681. XML_RNGP_PAT_LIST_ELEM = 1079
  9682. XML_RNGP_PAT_LIST_INTERLEAVE = 1080
  9683. XML_RNGP_PAT_LIST_LIST = 1081
  9684. XML_RNGP_PAT_LIST_REF = 1082
  9685. XML_RNGP_PAT_LIST_TEXT = 1083
  9686. XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME = 1084
  9687. XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME = 1085
  9688. XML_RNGP_PAT_ONEMORE_GROUP_ATTR = 1086
  9689. XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR = 1087
  9690. XML_RNGP_PAT_START_ATTR = 1088
  9691. XML_RNGP_PAT_START_DATA = 1089
  9692. XML_RNGP_PAT_START_EMPTY = 1090
  9693. XML_RNGP_PAT_START_GROUP = 1091
  9694. XML_RNGP_PAT_START_INTERLEAVE = 1092
  9695. XML_RNGP_PAT_START_LIST = 1093
  9696. XML_RNGP_PAT_START_ONEMORE = 1094
  9697. XML_RNGP_PAT_START_TEXT = 1095
  9698. XML_RNGP_PAT_START_VALUE = 1096
  9699. XML_RNGP_PREFIX_UNDEFINED = 1097
  9700. XML_RNGP_REF_CREATE_FAILED = 1098
  9701. XML_RNGP_REF_CYCLE = 1099
  9702. XML_RNGP_REF_NAME_INVALID = 1100
  9703. XML_RNGP_REF_NO_DEF = 1101
  9704. XML_RNGP_REF_NO_NAME = 1102
  9705. XML_RNGP_REF_NOT_EMPTY = 1103
  9706. XML_RNGP_START_CHOICE_AND_INTERLEAVE = 1104
  9707. XML_RNGP_START_CONTENT = 1105
  9708. XML_RNGP_START_EMPTY = 1106
  9709. XML_RNGP_START_MISSING = 1107
  9710. XML_RNGP_TEXT_EXPECTED = 1108
  9711. XML_RNGP_TEXT_HAS_CHILD = 1109
  9712. XML_RNGP_TYPE_MISSING = 1110
  9713. XML_RNGP_TYPE_NOT_FOUND = 1111
  9714. XML_RNGP_TYPE_VALUE = 1112
  9715. XML_RNGP_UNKNOWN_ATTRIBUTE = 1113
  9716. XML_RNGP_UNKNOWN_COMBINE = 1114
  9717. XML_RNGP_UNKNOWN_CONSTRUCT = 1115
  9718. XML_RNGP_UNKNOWN_TYPE_LIB = 1116
  9719. XML_RNGP_URI_FRAGMENT = 1117
  9720. XML_RNGP_URI_NOT_ABSOLUTE = 1118
  9721. XML_RNGP_VALUE_EMPTY = 1119
  9722. XML_RNGP_VALUE_NO_CONTENT = 1120
  9723. XML_RNGP_XMLNS_NAME = 1121
  9724. XML_RNGP_XML_NS = 1122
  9725. XML_XPATH_EXPRESSION_OK = 1200
  9726. XML_XPATH_NUMBER_ERROR = 1201
  9727. XML_XPATH_UNFINISHED_LITERAL_ERROR = 1202
  9728. XML_XPATH_START_LITERAL_ERROR = 1203
  9729. XML_XPATH_VARIABLE_REF_ERROR = 1204
  9730. XML_XPATH_UNDEF_VARIABLE_ERROR = 1205
  9731. XML_XPATH_INVALID_PREDICATE_ERROR = 1206
  9732. XML_XPATH_EXPR_ERROR = 1207
  9733. XML_XPATH_UNCLOSED_ERROR = 1208
  9734. XML_XPATH_UNKNOWN_FUNC_ERROR = 1209
  9735. XML_XPATH_INVALID_OPERAND = 1210
  9736. XML_XPATH_INVALID_TYPE = 1211
  9737. XML_XPATH_INVALID_ARITY = 1212
  9738. XML_XPATH_INVALID_CTXT_SIZE = 1213
  9739. XML_XPATH_INVALID_CTXT_POSITION = 1214
  9740. XML_XPATH_MEMORY_ERROR = 1215
  9741. XML_XPTR_SYNTAX_ERROR = 1216
  9742. XML_XPTR_RESOURCE_ERROR = 1217
  9743. XML_XPTR_SUB_RESOURCE_ERROR = 1218
  9744. XML_XPATH_UNDEF_PREFIX_ERROR = 1219
  9745. XML_XPATH_ENCODING_ERROR = 1220
  9746. XML_XPATH_INVALID_CHAR_ERROR = 1221
  9747. XML_TREE_INVALID_HEX = 1300
  9748. XML_TREE_INVALID_DEC = 1301
  9749. XML_TREE_UNTERMINATED_ENTITY = 1302
  9750. XML_TREE_NOT_UTF8 = 1303
  9751. XML_SAVE_NOT_UTF8 = 1400
  9752. XML_SAVE_CHAR_INVALID = 1401
  9753. XML_SAVE_NO_DOCTYPE = 1402
  9754. XML_SAVE_UNKNOWN_ENCODING = 1403
  9755. XML_REGEXP_COMPILE_ERROR = 1450
  9756. XML_IO_UNKNOWN = 1500
  9757. XML_IO_EACCES = 1501
  9758. XML_IO_EAGAIN = 1502
  9759. XML_IO_EBADF = 1503
  9760. XML_IO_EBADMSG = 1504
  9761. XML_IO_EBUSY = 1505
  9762. XML_IO_ECANCELED = 1506
  9763. XML_IO_ECHILD = 1507
  9764. XML_IO_EDEADLK = 1508
  9765. XML_IO_EDOM = 1509
  9766. XML_IO_EEXIST = 1510
  9767. XML_IO_EFAULT = 1511
  9768. XML_IO_EFBIG = 1512
  9769. XML_IO_EINPROGRESS = 1513
  9770. XML_IO_EINTR = 1514
  9771. XML_IO_EINVAL = 1515
  9772. XML_IO_EIO = 1516
  9773. XML_IO_EISDIR = 1517
  9774. XML_IO_EMFILE = 1518
  9775. XML_IO_EMLINK = 1519
  9776. XML_IO_EMSGSIZE = 1520
  9777. XML_IO_ENAMETOOLONG = 1521
  9778. XML_IO_ENFILE = 1522
  9779. XML_IO_ENODEV = 1523
  9780. XML_IO_ENOENT = 1524
  9781. XML_IO_ENOEXEC = 1525
  9782. XML_IO_ENOLCK = 1526
  9783. XML_IO_ENOMEM = 1527
  9784. XML_IO_ENOSPC = 1528
  9785. XML_IO_ENOSYS = 1529
  9786. XML_IO_ENOTDIR = 1530
  9787. XML_IO_ENOTEMPTY = 1531
  9788. XML_IO_ENOTSUP = 1532
  9789. XML_IO_ENOTTY = 1533
  9790. XML_IO_ENXIO = 1534
  9791. XML_IO_EPERM = 1535
  9792. XML_IO_EPIPE = 1536
  9793. XML_IO_ERANGE = 1537
  9794. XML_IO_EROFS = 1538
  9795. XML_IO_ESPIPE = 1539
  9796. XML_IO_ESRCH = 1540
  9797. XML_IO_ETIMEDOUT = 1541
  9798. XML_IO_EXDEV = 1542
  9799. XML_IO_NETWORK_ATTEMPT = 1543
  9800. XML_IO_ENCODER = 1544
  9801. XML_IO_FLUSH = 1545
  9802. XML_IO_WRITE = 1546
  9803. XML_IO_NO_INPUT = 1547
  9804. XML_IO_BUFFER_FULL = 1548
  9805. XML_IO_LOAD_ERROR = 1549
  9806. XML_IO_ENOTSOCK = 1550
  9807. XML_IO_EISCONN = 1551
  9808. XML_IO_ECONNREFUSED = 1552
  9809. XML_IO_ENETUNREACH = 1553
  9810. XML_IO_EADDRINUSE = 1554
  9811. XML_IO_EALREADY = 1555
  9812. XML_IO_EAFNOSUPPORT = 1556
  9813. XML_XINCLUDE_RECURSION = 1600
  9814. XML_XINCLUDE_PARSE_VALUE = 1601
  9815. XML_XINCLUDE_ENTITY_DEF_MISMATCH = 1602
  9816. XML_XINCLUDE_NO_HREF = 1603
  9817. XML_XINCLUDE_NO_FALLBACK = 1604
  9818. XML_XINCLUDE_HREF_URI = 1605
  9819. XML_XINCLUDE_TEXT_FRAGMENT = 1606
  9820. XML_XINCLUDE_TEXT_DOCUMENT = 1607
  9821. XML_XINCLUDE_INVALID_CHAR = 1608
  9822. XML_XINCLUDE_BUILD_FAILED = 1609
  9823. XML_XINCLUDE_UNKNOWN_ENCODING = 1610
  9824. XML_XINCLUDE_MULTIPLE_ROOT = 1611
  9825. XML_XINCLUDE_XPTR_FAILED = 1612
  9826. XML_XINCLUDE_XPTR_RESULT = 1613
  9827. XML_XINCLUDE_INCLUDE_IN_INCLUDE = 1614
  9828. XML_XINCLUDE_FALLBACKS_IN_INCLUDE = 1615
  9829. XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE = 1616
  9830. XML_XINCLUDE_DEPRECATED_NS = 1617
  9831. XML_XINCLUDE_FRAGMENT_ID = 1618
  9832. XML_CATALOG_MISSING_ATTR = 1650
  9833. XML_CATALOG_ENTRY_BROKEN = 1651
  9834. XML_CATALOG_PREFER_VALUE = 1652
  9835. XML_CATALOG_NOT_CATALOG = 1653
  9836. XML_CATALOG_RECURSION = 1654
  9837. XML_SCHEMAP_PREFIX_UNDEFINED = 1700
  9838. XML_SCHEMAP_ATTRFORMDEFAULT_VALUE = 1701
  9839. XML_SCHEMAP_ATTRGRP_NONAME_NOREF = 1702
  9840. XML_SCHEMAP_ATTR_NONAME_NOREF = 1703
  9841. XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF = 1704
  9842. XML_SCHEMAP_ELEMFORMDEFAULT_VALUE = 1705
  9843. XML_SCHEMAP_ELEM_NONAME_NOREF = 1706
  9844. XML_SCHEMAP_EXTENSION_NO_BASE = 1707
  9845. XML_SCHEMAP_FACET_NO_VALUE = 1708
  9846. XML_SCHEMAP_FAILED_BUILD_IMPORT = 1709
  9847. XML_SCHEMAP_GROUP_NONAME_NOREF = 1710
  9848. XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI = 1711
  9849. XML_SCHEMAP_IMPORT_REDEFINE_NSNAME = 1712
  9850. XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI = 1713
  9851. XML_SCHEMAP_INVALID_BOOLEAN = 1714
  9852. XML_SCHEMAP_INVALID_ENUM = 1715
  9853. XML_SCHEMAP_INVALID_FACET = 1716
  9854. XML_SCHEMAP_INVALID_FACET_VALUE = 1717
  9855. XML_SCHEMAP_INVALID_MAXOCCURS = 1718
  9856. XML_SCHEMAP_INVALID_MINOCCURS = 1719
  9857. XML_SCHEMAP_INVALID_REF_AND_SUBTYPE = 1720
  9858. XML_SCHEMAP_INVALID_WHITE_SPACE = 1721
  9859. XML_SCHEMAP_NOATTR_NOREF = 1722
  9860. XML_SCHEMAP_NOTATION_NO_NAME = 1723
  9861. XML_SCHEMAP_NOTYPE_NOREF = 1724
  9862. XML_SCHEMAP_REF_AND_SUBTYPE = 1725
  9863. XML_SCHEMAP_RESTRICTION_NONAME_NOREF = 1726
  9864. XML_SCHEMAP_SIMPLETYPE_NONAME = 1727
  9865. XML_SCHEMAP_TYPE_AND_SUBTYPE = 1728
  9866. XML_SCHEMAP_UNKNOWN_ALL_CHILD = 1729
  9867. XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD = 1730
  9868. XML_SCHEMAP_UNKNOWN_ATTR_CHILD = 1731
  9869. XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD = 1732
  9870. XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP = 1733
  9871. XML_SCHEMAP_UNKNOWN_BASE_TYPE = 1734
  9872. XML_SCHEMAP_UNKNOWN_CHOICE_CHILD = 1735
  9873. XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD = 1736
  9874. XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD = 1737
  9875. XML_SCHEMAP_UNKNOWN_ELEM_CHILD = 1738
  9876. XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD = 1739
  9877. XML_SCHEMAP_UNKNOWN_FACET_CHILD = 1740
  9878. XML_SCHEMAP_UNKNOWN_FACET_TYPE = 1741
  9879. XML_SCHEMAP_UNKNOWN_GROUP_CHILD = 1742
  9880. XML_SCHEMAP_UNKNOWN_IMPORT_CHILD = 1743
  9881. XML_SCHEMAP_UNKNOWN_LIST_CHILD = 1744
  9882. XML_SCHEMAP_UNKNOWN_NOTATION_CHILD = 1745
  9883. XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD = 1746
  9884. XML_SCHEMAP_UNKNOWN_REF = 1747
  9885. XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD = 1748
  9886. XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD = 1749
  9887. XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD = 1750
  9888. XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD = 1751
  9889. XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD = 1752
  9890. XML_SCHEMAP_UNKNOWN_TYPE = 1753
  9891. XML_SCHEMAP_UNKNOWN_UNION_CHILD = 1754
  9892. XML_SCHEMAP_ELEM_DEFAULT_FIXED = 1755
  9893. XML_SCHEMAP_REGEXP_INVALID = 1756
  9894. XML_SCHEMAP_FAILED_LOAD = 1757
  9895. XML_SCHEMAP_NOTHING_TO_PARSE = 1758
  9896. XML_SCHEMAP_NOROOT = 1759
  9897. XML_SCHEMAP_REDEFINED_GROUP = 1760
  9898. XML_SCHEMAP_REDEFINED_TYPE = 1761
  9899. XML_SCHEMAP_REDEFINED_ELEMENT = 1762
  9900. XML_SCHEMAP_REDEFINED_ATTRGROUP = 1763
  9901. XML_SCHEMAP_REDEFINED_ATTR = 1764
  9902. XML_SCHEMAP_REDEFINED_NOTATION = 1765
  9903. XML_SCHEMAP_FAILED_PARSE = 1766
  9904. XML_SCHEMAP_UNKNOWN_PREFIX = 1767
  9905. XML_SCHEMAP_DEF_AND_PREFIX = 1768
  9906. XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD = 1769
  9907. XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI = 1770
  9908. XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI = 1771
  9909. XML_SCHEMAP_NOT_SCHEMA = 1772
  9910. XML_SCHEMAP_UNKNOWN_MEMBER_TYPE = 1773
  9911. XML_SCHEMAP_INVALID_ATTR_USE = 1774
  9912. XML_SCHEMAP_RECURSIVE = 1775
  9913. XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE = 1776
  9914. XML_SCHEMAP_INVALID_ATTR_COMBINATION = 1777
  9915. XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION = 1778
  9916. XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD = 1779
  9917. XML_SCHEMAP_INVALID_ATTR_NAME = 1780
  9918. XML_SCHEMAP_REF_AND_CONTENT = 1781
  9919. XML_SCHEMAP_CT_PROPS_CORRECT_1 = 1782
  9920. XML_SCHEMAP_CT_PROPS_CORRECT_2 = 1783
  9921. XML_SCHEMAP_CT_PROPS_CORRECT_3 = 1784
  9922. XML_SCHEMAP_CT_PROPS_CORRECT_4 = 1785
  9923. XML_SCHEMAP_CT_PROPS_CORRECT_5 = 1786
  9924. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1 = 1787
  9925. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 = 1788
  9926. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 = 1789
  9927. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 = 1790
  9928. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3 = 1791
  9929. XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER = 1792
  9930. XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE = 1793
  9931. XML_SCHEMAP_UNION_NOT_EXPRESSIBLE = 1794
  9932. XML_SCHEMAP_SRC_IMPORT_3_1 = 1795
  9933. XML_SCHEMAP_SRC_IMPORT_3_2 = 1796
  9934. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 = 1797
  9935. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 = 1798
  9936. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 = 1799
  9937. XML_SCHEMAP_COS_CT_EXTENDS_1_3 = 1800
  9938. XML_SCHEMAV_NOROOT = 1801
  9939. XML_SCHEMAV_UNDECLAREDELEM = 1802
  9940. XML_SCHEMAV_NOTTOPLEVEL = 1803
  9941. XML_SCHEMAV_MISSING = 1804
  9942. XML_SCHEMAV_WRONGELEM = 1805
  9943. XML_SCHEMAV_NOTYPE = 1806
  9944. XML_SCHEMAV_NOROLLBACK = 1807
  9945. XML_SCHEMAV_ISABSTRACT = 1808
  9946. XML_SCHEMAV_NOTEMPTY = 1809
  9947. XML_SCHEMAV_ELEMCONT = 1810
  9948. XML_SCHEMAV_HAVEDEFAULT = 1811
  9949. XML_SCHEMAV_NOTNILLABLE = 1812
  9950. XML_SCHEMAV_EXTRACONTENT = 1813
  9951. XML_SCHEMAV_INVALIDATTR = 1814
  9952. XML_SCHEMAV_INVALIDELEM = 1815
  9953. XML_SCHEMAV_NOTDETERMINIST = 1816
  9954. XML_SCHEMAV_CONSTRUCT = 1817
  9955. XML_SCHEMAV_INTERNAL = 1818
  9956. XML_SCHEMAV_NOTSIMPLE = 1819
  9957. XML_SCHEMAV_ATTRUNKNOWN = 1820
  9958. XML_SCHEMAV_ATTRINVALID = 1821
  9959. XML_SCHEMAV_VALUE = 1822
  9960. XML_SCHEMAV_FACET = 1823
  9961. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1 = 1824
  9962. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2 = 1825
  9963. XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3 = 1826
  9964. XML_SCHEMAV_CVC_TYPE_3_1_1 = 1827
  9965. XML_SCHEMAV_CVC_TYPE_3_1_2 = 1828
  9966. XML_SCHEMAV_CVC_FACET_VALID = 1829
  9967. XML_SCHEMAV_CVC_LENGTH_VALID = 1830
  9968. XML_SCHEMAV_CVC_MINLENGTH_VALID = 1831
  9969. XML_SCHEMAV_CVC_MAXLENGTH_VALID = 1832
  9970. XML_SCHEMAV_CVC_MININCLUSIVE_VALID = 1833
  9971. XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID = 1834
  9972. XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID = 1835
  9973. XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID = 1836
  9974. XML_SCHEMAV_CVC_TOTALDIGITS_VALID = 1837
  9975. XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID = 1838
  9976. XML_SCHEMAV_CVC_PATTERN_VALID = 1839
  9977. XML_SCHEMAV_CVC_ENUMERATION_VALID = 1840
  9978. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1 = 1841
  9979. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2 = 1842
  9980. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3 = 1843
  9981. XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4 = 1844
  9982. XML_SCHEMAV_CVC_ELT_1 = 1845
  9983. XML_SCHEMAV_CVC_ELT_2 = 1846
  9984. XML_SCHEMAV_CVC_ELT_3_1 = 1847
  9985. XML_SCHEMAV_CVC_ELT_3_2_1 = 1848
  9986. XML_SCHEMAV_CVC_ELT_3_2_2 = 1849
  9987. XML_SCHEMAV_CVC_ELT_4_1 = 1850
  9988. XML_SCHEMAV_CVC_ELT_4_2 = 1851
  9989. XML_SCHEMAV_CVC_ELT_4_3 = 1852
  9990. XML_SCHEMAV_CVC_ELT_5_1_1 = 1853
  9991. XML_SCHEMAV_CVC_ELT_5_1_2 = 1854
  9992. XML_SCHEMAV_CVC_ELT_5_2_1 = 1855
  9993. XML_SCHEMAV_CVC_ELT_5_2_2_1 = 1856
  9994. XML_SCHEMAV_CVC_ELT_5_2_2_2_1 = 1857
  9995. XML_SCHEMAV_CVC_ELT_5_2_2_2_2 = 1858
  9996. XML_SCHEMAV_CVC_ELT_6 = 1859
  9997. XML_SCHEMAV_CVC_ELT_7 = 1860
  9998. XML_SCHEMAV_CVC_ATTRIBUTE_1 = 1861
  9999. XML_SCHEMAV_CVC_ATTRIBUTE_2 = 1862
  10000. XML_SCHEMAV_CVC_ATTRIBUTE_3 = 1863
  10001. XML_SCHEMAV_CVC_ATTRIBUTE_4 = 1864
  10002. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1 = 1865
  10003. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 = 1866
  10004. XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 = 1867
  10005. XML_SCHEMAV_CVC_COMPLEX_TYPE_4 = 1868
  10006. XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1 = 1869
  10007. XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2 = 1870
  10008. XML_SCHEMAV_ELEMENT_CONTENT = 1871
  10009. XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING = 1872
  10010. XML_SCHEMAV_CVC_COMPLEX_TYPE_1 = 1873
  10011. XML_SCHEMAV_CVC_AU = 1874
  10012. XML_SCHEMAV_CVC_TYPE_1 = 1875
  10013. XML_SCHEMAV_CVC_TYPE_2 = 1876
  10014. XML_SCHEMAV_CVC_IDC = 1877
  10015. XML_SCHEMAV_CVC_WILDCARD = 1878
  10016. XML_SCHEMAV_MISC = 1879
  10017. XML_XPTR_UNKNOWN_SCHEME = 1900
  10018. XML_XPTR_CHILDSEQ_START = 1901
  10019. XML_XPTR_EVAL_FAILED = 1902
  10020. XML_XPTR_EXTRA_OBJECTS = 1903
  10021. XML_C14N_CREATE_CTXT = 1950
  10022. XML_C14N_REQUIRES_UTF8 = 1951
  10023. XML_C14N_CREATE_STACK = 1952
  10024. XML_C14N_INVALID_NODE = 1953
  10025. XML_C14N_UNKNOW_NODE = 1954
  10026. XML_C14N_RELATIVE_NAMESPACE = 1955
  10027. XML_FTP_PASV_ANSWER = 2000
  10028. XML_FTP_EPSV_ANSWER = 2001
  10029. XML_FTP_ACCNT = 2002
  10030. XML_FTP_URL_SYNTAX = 2003
  10031. XML_HTTP_URL_SYNTAX = 2020
  10032. XML_HTTP_USE_IP = 2021
  10033. XML_HTTP_UNKNOWN_HOST = 2022
  10034. XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000
  10035. XML_SCHEMAP_SRC_SIMPLE_TYPE_2 = 3001
  10036. XML_SCHEMAP_SRC_SIMPLE_TYPE_3 = 3002
  10037. XML_SCHEMAP_SRC_SIMPLE_TYPE_4 = 3003
  10038. XML_SCHEMAP_SRC_RESOLVE = 3004
  10039. XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE = 3005
  10040. XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE = 3006
  10041. XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES = 3007
  10042. XML_SCHEMAP_ST_PROPS_CORRECT_1 = 3008
  10043. XML_SCHEMAP_ST_PROPS_CORRECT_2 = 3009
  10044. XML_SCHEMAP_ST_PROPS_CORRECT_3 = 3010
  10045. XML_SCHEMAP_COS_ST_RESTRICTS_1_1 = 3011
  10046. XML_SCHEMAP_COS_ST_RESTRICTS_1_2 = 3012
  10047. XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1 = 3013
  10048. XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2 = 3014
  10049. XML_SCHEMAP_COS_ST_RESTRICTS_2_1 = 3015
  10050. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 = 3016
  10051. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 = 3017
  10052. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 = 3018
  10053. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 = 3019
  10054. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 = 3020
  10055. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 = 3021
  10056. XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 = 3022
  10057. XML_SCHEMAP_COS_ST_RESTRICTS_3_1 = 3023
  10058. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1 = 3024
  10059. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 = 3025
  10060. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 = 3026
  10061. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 = 3027
  10062. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 = 3028
  10063. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 = 3029
  10064. XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 = 3030
  10065. XML_SCHEMAP_COS_ST_DERIVED_OK_2_1 = 3031
  10066. XML_SCHEMAP_COS_ST_DERIVED_OK_2_2 = 3032
  10067. XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED = 3033
  10068. XML_SCHEMAP_S4S_ELEM_MISSING = 3034
  10069. XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED = 3035
  10070. XML_SCHEMAP_S4S_ATTR_MISSING = 3036
  10071. XML_SCHEMAP_S4S_ATTR_INVALID_VALUE = 3037
  10072. XML_SCHEMAP_SRC_ELEMENT_1 = 3038
  10073. XML_SCHEMAP_SRC_ELEMENT_2_1 = 3039
  10074. XML_SCHEMAP_SRC_ELEMENT_2_2 = 3040
  10075. XML_SCHEMAP_SRC_ELEMENT_3 = 3041
  10076. XML_SCHEMAP_P_PROPS_CORRECT_1 = 3042
  10077. XML_SCHEMAP_P_PROPS_CORRECT_2_1 = 3043
  10078. XML_SCHEMAP_P_PROPS_CORRECT_2_2 = 3044
  10079. XML_SCHEMAP_E_PROPS_CORRECT_2 = 3045
  10080. XML_SCHEMAP_E_PROPS_CORRECT_3 = 3046
  10081. XML_SCHEMAP_E_PROPS_CORRECT_4 = 3047
  10082. XML_SCHEMAP_E_PROPS_CORRECT_5 = 3048
  10083. XML_SCHEMAP_E_PROPS_CORRECT_6 = 3049
  10084. XML_SCHEMAP_SRC_INCLUDE = 3050
  10085. XML_SCHEMAP_SRC_ATTRIBUTE_1 = 3051
  10086. XML_SCHEMAP_SRC_ATTRIBUTE_2 = 3052
  10087. XML_SCHEMAP_SRC_ATTRIBUTE_3_1 = 3053
  10088. XML_SCHEMAP_SRC_ATTRIBUTE_3_2 = 3054
  10089. XML_SCHEMAP_SRC_ATTRIBUTE_4 = 3055
  10090. XML_SCHEMAP_NO_XMLNS = 3056
  10091. XML_SCHEMAP_NO_XSI = 3057
  10092. XML_SCHEMAP_COS_VALID_DEFAULT_1 = 3058
  10093. XML_SCHEMAP_COS_VALID_DEFAULT_2_1 = 3059
  10094. XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1 = 3060
  10095. XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2 = 3061
  10096. XML_SCHEMAP_CVC_SIMPLE_TYPE = 3062
  10097. XML_SCHEMAP_COS_CT_EXTENDS_1_1 = 3063
  10098. XML_SCHEMAP_SRC_IMPORT_1_1 = 3064
  10099. XML_SCHEMAP_SRC_IMPORT_1_2 = 3065
  10100. XML_SCHEMAP_SRC_IMPORT_2 = 3066
  10101. XML_SCHEMAP_SRC_IMPORT_2_1 = 3067
  10102. XML_SCHEMAP_SRC_IMPORT_2_2 = 3068
  10103. XML_SCHEMAP_INTERNAL = 3069
  10104. XML_SCHEMAP_NOT_DETERMINISTIC = 3070
  10105. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1 = 3071
  10106. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2 = 3072
  10107. XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3 = 3073
  10108. XML_SCHEMAP_MG_PROPS_CORRECT_1 = 3074
  10109. XML_SCHEMAP_MG_PROPS_CORRECT_2 = 3075
  10110. XML_SCHEMAP_SRC_CT_1 = 3076
  10111. XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 = 3077
  10112. XML_SCHEMAP_AU_PROPS_CORRECT_2 = 3078
  10113. XML_SCHEMAP_A_PROPS_CORRECT_2 = 3079
  10114. XML_SCHEMAP_C_PROPS_CORRECT = 3080
  10115. XML_SCHEMAP_SRC_REDEFINE = 3081
  10116. XML_SCHEMAP_SRC_IMPORT = 3082
  10117. XML_SCHEMAP_WARN_SKIP_SCHEMA = 3083
  10118. XML_SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084
  10119. XML_SCHEMAP_WARN_ATTR_REDECL_PROH = 3085
  10120. XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086
  10121. XML_SCHEMAP_AG_PROPS_CORRECT = 3087
  10122. XML_SCHEMAP_COS_CT_EXTENDS_1_2 = 3088
  10123. XML_SCHEMAP_AU_PROPS_CORRECT = 3089
  10124. XML_SCHEMAP_A_PROPS_CORRECT_3 = 3090
  10125. XML_SCHEMAP_COS_ALL_LIMITED = 3091
  10126. XML_SCHEMATRONV_ASSERT = 4000
  10127. XML_SCHEMATRONV_REPORT = 4001
  10128. XML_MODULE_OPEN = 4900
  10129. XML_MODULE_CLOSE = 4901
  10130. XML_CHECK_FOUND_ELEMENT = 5000
  10131. XML_CHECK_FOUND_ATTRIBUTE = 5001
  10132. XML_CHECK_FOUND_TEXT = 5002
  10133. XML_CHECK_FOUND_CDATA = 5003
  10134. XML_CHECK_FOUND_ENTITYREF = 5004
  10135. XML_CHECK_FOUND_ENTITY = 5005
  10136. XML_CHECK_FOUND_PI = 5006
  10137. XML_CHECK_FOUND_COMMENT = 5007
  10138. XML_CHECK_FOUND_DOCTYPE = 5008
  10139. XML_CHECK_FOUND_FRAGMENT = 5009
  10140. XML_CHECK_FOUND_NOTATION = 5010
  10141. XML_CHECK_UNKNOWN_NODE = 5011
  10142. XML_CHECK_ENTITY_TYPE = 5012
  10143. XML_CHECK_NO_PARENT = 5013
  10144. XML_CHECK_NO_DOC = 5014
  10145. XML_CHECK_NO_NAME = 5015
  10146. XML_CHECK_NO_ELEM = 5016
  10147. XML_CHECK_WRONG_DOC = 5017
  10148. XML_CHECK_NO_PREV = 5018
  10149. XML_CHECK_WRONG_PREV = 5019
  10150. XML_CHECK_NO_NEXT = 5020
  10151. XML_CHECK_WRONG_NEXT = 5021
  10152. XML_CHECK_NOT_DTD = 5022
  10153. XML_CHECK_NOT_ATTR = 5023
  10154. XML_CHECK_NOT_ATTR_DECL = 5024
  10155. XML_CHECK_NOT_ELEM_DECL = 5025
  10156. XML_CHECK_NOT_ENTITY_DECL = 5026
  10157. XML_CHECK_NOT_NS_DECL = 5027
  10158. XML_CHECK_NO_HREF = 5028
  10159. XML_CHECK_WRONG_PARENT = 5029
  10160. XML_CHECK_NS_SCOPE = 5030
  10161. XML_CHECK_NS_ANCESTOR = 5031
  10162. XML_CHECK_NOT_UTF8 = 5032
  10163. XML_CHECK_NO_DICT = 5033
  10164. XML_CHECK_NOT_NCNAME = 5034
  10165. XML_CHECK_OUTSIDE_DICT = 5035
  10166. XML_CHECK_WRONG_NAME = 5036
  10167. XML_CHECK_NAME_NOT_NULL = 5037
  10168. XML_I18N_NO_NAME = 6000
  10169. XML_I18N_NO_HANDLER = 6001
  10170. XML_I18N_EXCESS_HANDLER = 6002
  10171. XML_I18N_CONV_FAILED = 6003
  10172. XML_I18N_NO_OUTPUT = 6004
  10173. XML_CHECK_ = 6005
  10174. XML_CHECK_X = 6006
  10175. XML_EXP_EMPTY = 0
  10176. XML_EXP_FORBID = 1
  10177. XML_EXP_ATOM = 2
  10178. XML_EXP_SEQ = 3
  10179. XML_EXP_OR = 4
  10180. XML_EXP_COUNT = 5
  10181. XML_MODULE_LAZY = 1
  10182. XML_MODULE_LOCAL = 2
  10183. XML_PARSER_LOADDTD = 1
  10184. XML_PARSER_DEFAULTATTRS = 2
  10185. XML_PARSER_VALIDATE = 3
  10186. XML_PARSER_SUBST_ENTITIES = 4
  10187. XML_READER_TYPE_NONE = 0
  10188. XML_READER_TYPE_ELEMENT = 1
  10189. XML_READER_TYPE_ATTRIBUTE = 2
  10190. XML_READER_TYPE_TEXT = 3
  10191. XML_READER_TYPE_CDATA = 4
  10192. XML_READER_TYPE_ENTITY_REFERENCE = 5
  10193. XML_READER_TYPE_ENTITY = 6
  10194. XML_READER_TYPE_PROCESSING_INSTRUCTION = 7
  10195. XML_READER_TYPE_COMMENT = 8
  10196. XML_READER_TYPE_DOCUMENT = 9
  10197. XML_READER_TYPE_DOCUMENT_TYPE = 10
  10198. XML_READER_TYPE_DOCUMENT_FRAGMENT = 11
  10199. XML_READER_TYPE_NOTATION = 12
  10200. XML_READER_TYPE_WHITESPACE = 13
  10201. XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14
  10202. XML_READER_TYPE_END_ELEMENT = 15
  10203. XML_READER_TYPE_END_ENTITY = 16
  10204. XML_READER_TYPE_XML_DECLARATION = 17
  10205. XML_CATA_PREFER_NONE = 0
  10206. XML_CATA_PREFER_PUBLIC = 1
  10207. XML_CATA_PREFER_SYSTEM = 2
  10208. XML_ELEMENT_NODE = 1
  10209. XML_ATTRIBUTE_NODE = 2
  10210. XML_TEXT_NODE = 3
  10211. XML_CDATA_SECTION_NODE = 4
  10212. XML_ENTITY_REF_NODE = 5
  10213. XML_ENTITY_NODE = 6
  10214. XML_PI_NODE = 7
  10215. XML_COMMENT_NODE = 8
  10216. XML_DOCUMENT_NODE = 9
  10217. XML_DOCUMENT_TYPE_NODE = 10
  10218. XML_DOCUMENT_FRAG_NODE = 11
  10219. XML_NOTATION_NODE = 12
  10220. XML_HTML_DOCUMENT_NODE = 13
  10221. XML_DTD_NODE = 14
  10222. XML_ELEMENT_DECL = 15
  10223. XML_ATTRIBUTE_DECL = 16
  10224. XML_ENTITY_DECL = 17
  10225. XML_NAMESPACE_DECL = 18
  10226. XML_XINCLUDE_START = 19
  10227. XML_XINCLUDE_END = 20
  10228. XML_DOCB_DOCUMENT_NODE = 21
  10229. XLINK_ACTUATE_NONE = 0
  10230. XLINK_ACTUATE_AUTO = 1
  10231. XLINK_ACTUATE_ONREQUEST = 2
  10232. XML_WITH_THREAD = 1
  10233. XML_WITH_TREE = 2
  10234. XML_WITH_OUTPUT = 3
  10235. XML_WITH_PUSH = 4
  10236. XML_WITH_READER = 5
  10237. XML_WITH_PATTERN = 6
  10238. XML_WITH_WRITER = 7
  10239. XML_WITH_SAX1 = 8
  10240. XML_WITH_FTP = 9
  10241. XML_WITH_HTTP = 10
  10242. XML_WITH_VALID = 11
  10243. XML_WITH_HTML = 12
  10244. XML_WITH_LEGACY = 13
  10245. XML_WITH_C14N = 14
  10246. XML_WITH_CATALOG = 15
  10247. XML_WITH_XPATH = 16
  10248. XML_WITH_XPTR = 17
  10249. XML_WITH_XINCLUDE = 18
  10250. XML_WITH_ICONV = 19
  10251. XML_WITH_ISO8859X = 20
  10252. XML_WITH_UNICODE = 21
  10253. XML_WITH_REGEXP = 22
  10254. XML_WITH_AUTOMATA = 23
  10255. XML_WITH_EXPR = 24
  10256. XML_WITH_SCHEMAS = 25
  10257. XML_WITH_SCHEMATRON = 26
  10258. XML_WITH_MODULES = 27
  10259. XML_WITH_DEBUG = 28
  10260. XML_WITH_DEBUG_MEM = 29
  10261. XML_WITH_DEBUG_RUN = 30
  10262. XML_WITH_ZLIB = 31
  10263. XML_WITH_NONE = 99999
  10264. XML_ELEMENT_CONTENT_ONCE = 1
  10265. XML_ELEMENT_CONTENT_OPT = 2
  10266. XML_ELEMENT_CONTENT_MULT = 3
  10267. XML_ELEMENT_CONTENT_PLUS = 4
  10268. XPATH_EXPRESSION_OK = 0
  10269. XPATH_NUMBER_ERROR = 1
  10270. XPATH_UNFINISHED_LITERAL_ERROR = 2
  10271. XPATH_START_LITERAL_ERROR = 3
  10272. XPATH_VARIABLE_REF_ERROR = 4
  10273. XPATH_UNDEF_VARIABLE_ERROR = 5
  10274. XPATH_INVALID_PREDICATE_ERROR = 6
  10275. XPATH_EXPR_ERROR = 7
  10276. XPATH_UNCLOSED_ERROR = 8
  10277. XPATH_UNKNOWN_FUNC_ERROR = 9
  10278. XPATH_INVALID_OPERAND = 10
  10279. XPATH_INVALID_TYPE = 11
  10280. XPATH_INVALID_ARITY = 12
  10281. XPATH_INVALID_CTXT_SIZE = 13
  10282. XPATH_INVALID_CTXT_POSITION = 14
  10283. XPATH_MEMORY_ERROR = 15
  10284. XPTR_SYNTAX_ERROR = 16
  10285. XPTR_RESOURCE_ERROR = 17
  10286. XPTR_SUB_RESOURCE_ERROR = 18
  10287. XPATH_UNDEF_PREFIX_ERROR = 19
  10288. XPATH_ENCODING_ERROR = 20
  10289. XPATH_INVALID_CHAR_ERROR = 21
  10290. XPATH_INVALID_CTXT = 22
  10291. XML_ELEMENT_CONTENT_PCDATA = 1
  10292. XML_ELEMENT_CONTENT_ELEMENT = 2
  10293. XML_ELEMENT_CONTENT_SEQ = 3
  10294. XML_ELEMENT_CONTENT_OR = 4
  10295. XML_TEXTREADER_MODE_INITIAL = 0
  10296. XML_TEXTREADER_MODE_INTERACTIVE = 1
  10297. XML_TEXTREADER_MODE_ERROR = 2
  10298. XML_TEXTREADER_MODE_EOF = 3
  10299. XML_TEXTREADER_MODE_CLOSED = 4
  10300. XML_TEXTREADER_MODE_READING = 5
  10301. XML_ERR_NONE = 0
  10302. XML_ERR_WARNING = 1
  10303. XML_ERR_ERROR = 2
  10304. XML_ERR_FATAL = 3
  10305. XML_CHAR_ENCODING_ERROR = -1
  10306. XML_CHAR_ENCODING_NONE = 0
  10307. XML_CHAR_ENCODING_UTF8 = 1
  10308. XML_CHAR_ENCODING_UTF16LE = 2
  10309. XML_CHAR_ENCODING_UTF16BE = 3
  10310. XML_CHAR_ENCODING_UCS4LE = 4
  10311. XML_CHAR_ENCODING_UCS4BE = 5
  10312. XML_CHAR_ENCODING_EBCDIC = 6
  10313. XML_CHAR_ENCODING_UCS4_2143 = 7
  10314. XML_CHAR_ENCODING_UCS4_3412 = 8
  10315. XML_CHAR_ENCODING_UCS2 = 9
  10316. XML_CHAR_ENCODING_8859_1 = 10
  10317. XML_CHAR_ENCODING_8859_2 = 11
  10318. XML_CHAR_ENCODING_8859_3 = 12
  10319. XML_CHAR_ENCODING_8859_4 = 13
  10320. XML_CHAR_ENCODING_8859_5 = 14
  10321. XML_CHAR_ENCODING_8859_6 = 15
  10322. XML_CHAR_ENCODING_8859_7 = 16
  10323. XML_CHAR_ENCODING_8859_8 = 17
  10324. XML_CHAR_ENCODING_8859_9 = 18
  10325. XML_CHAR_ENCODING_2022_JP = 19
  10326. XML_CHAR_ENCODING_SHIFT_JIS = 20
  10327. XML_CHAR_ENCODING_EUC_JP = 21
  10328. XML_CHAR_ENCODING_ASCII = 22
  10329. XML_FROM_NONE = 0
  10330. XML_FROM_PARSER = 1
  10331. XML_FROM_TREE = 2
  10332. XML_FROM_NAMESPACE = 3
  10333. XML_FROM_DTD = 4
  10334. XML_FROM_HTML = 5
  10335. XML_FROM_MEMORY = 6
  10336. XML_FROM_OUTPUT = 7
  10337. XML_FROM_IO = 8
  10338. XML_FROM_FTP = 9
  10339. XML_FROM_HTTP = 10
  10340. XML_FROM_XINCLUDE = 11
  10341. XML_FROM_XPATH = 12
  10342. XML_FROM_XPOINTER = 13
  10343. XML_FROM_REGEXP = 14
  10344. XML_FROM_DATATYPE = 15
  10345. XML_FROM_SCHEMASP = 16
  10346. XML_FROM_SCHEMASV = 17
  10347. XML_FROM_RELAXNGP = 18
  10348. XML_FROM_RELAXNGV = 19
  10349. XML_FROM_CATALOG = 20
  10350. XML_FROM_C14N = 21
  10351. XML_FROM_XSLT = 22
  10352. XML_FROM_VALID = 23
  10353. XML_FROM_CHECK = 24
  10354. XML_FROM_WRITER = 25
  10355. XML_FROM_MODULE = 26
  10356. XML_FROM_I18N = 27
  10357. XML_FROM_SCHEMATRONV = 28
  10358. HTML_NA = 0
  10359. HTML_INVALID = 1
  10360. HTML_DEPRECATED = 2
  10361. HTML_VALID = 4
  10362. HTML_REQUIRED = 12
  10363. XML_SCHEMA_VAL_VC_I_CREATE = 1
  10364. XML_SCHEMA_WHITESPACE_UNKNOWN = 0
  10365. XML_SCHEMA_WHITESPACE_PRESERVE = 1
  10366. XML_SCHEMA_WHITESPACE_REPLACE = 2
  10367. XML_SCHEMA_WHITESPACE_COLLAPSE = 3
  10368. HTML_PARSE_RECOVER = 1
  10369. HTML_PARSE_NOERROR = 32
  10370. HTML_PARSE_NOWARNING = 64
  10371. HTML_PARSE_PEDANTIC = 128
  10372. HTML_PARSE_NOBLANKS = 256
  10373. HTML_PARSE_NONET = 2048
  10374. HTML_PARSE_COMPACT = 65536
  10375. XML_RELAXNG_OK = 0
  10376. XML_RELAXNG_ERR_MEMORY = 1
  10377. XML_RELAXNG_ERR_TYPE = 2
  10378. XML_RELAXNG_ERR_TYPEVAL = 3
  10379. XML_RELAXNG_ERR_DUPID = 4
  10380. XML_RELAXNG_ERR_TYPECMP = 5
  10381. XML_RELAXNG_ERR_NOSTATE = 6
  10382. XML_RELAXNG_ERR_NODEFINE = 7
  10383. XML_RELAXNG_ERR_LISTEXTRA = 8
  10384. XML_RELAXNG_ERR_LISTEMPTY = 9
  10385. XML_RELAXNG_ERR_INTERNODATA = 10
  10386. XML_RELAXNG_ERR_INTERSEQ = 11
  10387. XML_RELAXNG_ERR_INTEREXTRA = 12
  10388. XML_RELAXNG_ERR_ELEMNAME = 13
  10389. XML_RELAXNG_ERR_ATTRNAME = 14
  10390. XML_RELAXNG_ERR_ELEMNONS = 15
  10391. XML_RELAXNG_ERR_ATTRNONS = 16
  10392. XML_RELAXNG_ERR_ELEMWRONGNS = 17
  10393. XML_RELAXNG_ERR_ATTRWRONGNS = 18
  10394. XML_RELAXNG_ERR_ELEMEXTRANS = 19
  10395. XML_RELAXNG_ERR_ATTREXTRANS = 20
  10396. XML_RELAXNG_ERR_ELEMNOTEMPTY = 21
  10397. XML_RELAXNG_ERR_NOELEM = 22
  10398. XML_RELAXNG_ERR_NOTELEM = 23
  10399. XML_RELAXNG_ERR_ATTRVALID = 24
  10400. XML_RELAXNG_ERR_CONTENTVALID = 25
  10401. XML_RELAXNG_ERR_EXTRACONTENT = 26
  10402. XML_RELAXNG_ERR_INVALIDATTR = 27
  10403. XML_RELAXNG_ERR_DATAELEM = 28
  10404. XML_RELAXNG_ERR_VALELEM = 29
  10405. XML_RELAXNG_ERR_LISTELEM = 30
  10406. XML_RELAXNG_ERR_DATATYPE = 31
  10407. XML_RELAXNG_ERR_VALUE = 32
  10408. XML_RELAXNG_ERR_LIST = 33
  10409. XML_RELAXNG_ERR_NOGRAMMAR = 34
  10410. XML_RELAXNG_ERR_EXTRADATA = 35
  10411. XML_RELAXNG_ERR_LACKDATA = 36
  10412. XML_RELAXNG_ERR_INTERNAL = 37
  10413. XML_RELAXNG_ERR_ELEMWRONG = 38
  10414. XML_RELAXNG_ERR_TEXTWRONG = 39
  10415. XML_CATA_ALLOW_NONE = 0
  10416. XML_CATA_ALLOW_GLOBAL = 1
  10417. XML_CATA_ALLOW_DOCUMENT = 2
  10418. XML_CATA_ALLOW_ALL = 3
  10419. XML_ATTRIBUTE_CDATA = 1
  10420. XML_ATTRIBUTE_ID = 2
  10421. XML_ATTRIBUTE_IDREF = 3
  10422. XML_ATTRIBUTE_IDREFS = 4
  10423. XML_ATTRIBUTE_ENTITY = 5
  10424. XML_ATTRIBUTE_ENTITIES = 6
  10425. XML_ATTRIBUTE_NMTOKEN = 7
  10426. XML_ATTRIBUTE_NMTOKENS = 8
  10427. XML_ATTRIBUTE_ENUMERATION = 9
  10428. XML_ATTRIBUTE_NOTATION = 10
  10429. XML_SCHEMATRON_OUT_QUIET = 1
  10430. XML_SCHEMATRON_OUT_TEXT = 2
  10431. XML_SCHEMATRON_OUT_XML = 4
  10432. XML_SCHEMATRON_OUT_ERROR = 8
  10433. XML_SCHEMATRON_OUT_FILE = 256
  10434. XML_SCHEMATRON_OUT_BUFFER = 512
  10435. XML_SCHEMATRON_OUT_IO = 1024
  10436. XML_SCHEMA_CONTENT_UNKNOWN = 0
  10437. XML_SCHEMA_CONTENT_EMPTY = 1
  10438. XML_SCHEMA_CONTENT_ELEMENTS = 2
  10439. XML_SCHEMA_CONTENT_MIXED = 3
  10440. XML_SCHEMA_CONTENT_SIMPLE = 4
  10441. XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5
  10442. XML_SCHEMA_CONTENT_BASIC = 6
  10443. XML_SCHEMA_CONTENT_ANY = 7
  10444. XML_SCHEMA_TYPE_BASIC = 1
  10445. XML_SCHEMA_TYPE_ANY = 2
  10446. XML_SCHEMA_TYPE_FACET = 3
  10447. XML_SCHEMA_TYPE_SIMPLE = 4
  10448. XML_SCHEMA_TYPE_COMPLEX = 5
  10449. XML_SCHEMA_TYPE_SEQUENCE = 6
  10450. XML_SCHEMA_TYPE_CHOICE = 7
  10451. XML_SCHEMA_TYPE_ALL = 8
  10452. XML_SCHEMA_TYPE_SIMPLE_CONTENT = 9
  10453. XML_SCHEMA_TYPE_COMPLEX_CONTENT = 10
  10454. XML_SCHEMA_TYPE_UR = 11
  10455. XML_SCHEMA_TYPE_RESTRICTION = 12
  10456. XML_SCHEMA_TYPE_EXTENSION = 13
  10457. XML_SCHEMA_TYPE_ELEMENT = 14
  10458. XML_SCHEMA_TYPE_ATTRIBUTE = 15
  10459. XML_SCHEMA_TYPE_ATTRIBUTEGROUP = 16
  10460. XML_SCHEMA_TYPE_GROUP = 17
  10461. XML_SCHEMA_TYPE_NOTATION = 18
  10462. XML_SCHEMA_TYPE_LIST = 19
  10463. XML_SCHEMA_TYPE_UNION = 20
  10464. XML_SCHEMA_TYPE_ANY_ATTRIBUTE = 21
  10465. XML_SCHEMA_TYPE_IDC_UNIQUE = 22
  10466. XML_SCHEMA_TYPE_IDC_KEY = 23
  10467. XML_SCHEMA_TYPE_IDC_KEYREF = 24
  10468. XML_SCHEMA_TYPE_PARTICLE = 25
  10469. XML_SCHEMA_TYPE_ATTRIBUTE_USE = 26
  10470. XML_SCHEMA_FACET_MININCLUSIVE = 1000
  10471. XML_SCHEMA_FACET_MINEXCLUSIVE = 1001
  10472. XML_SCHEMA_FACET_MAXINCLUSIVE = 1002
  10473. XML_SCHEMA_FACET_MAXEXCLUSIVE = 1003
  10474. XML_SCHEMA_FACET_TOTALDIGITS = 1004
  10475. XML_SCHEMA_FACET_FRACTIONDIGITS = 1005
  10476. XML_SCHEMA_FACET_PATTERN = 1006
  10477. XML_SCHEMA_FACET_ENUMERATION = 1007
  10478. XML_SCHEMA_FACET_WHITESPACE = 1008
  10479. XML_SCHEMA_FACET_LENGTH = 1009
  10480. XML_SCHEMA_FACET_MAXLENGTH = 1010
  10481. XML_SCHEMA_FACET_MINLENGTH = 1011
  10482. XML_SCHEMA_EXTRA_QNAMEREF = 2000
  10483. XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001
  10484. XML_PARSE_UNKNOWN = 0
  10485. XML_PARSE_DOM = 1
  10486. XML_PARSE_SAX = 2
  10487. XML_PARSE_PUSH_DOM = 3
  10488. XML_PARSE_PUSH_SAX = 4
  10489. XML_PARSE_READER = 5
  10490. XML_PARSE_RECOVER = 1
  10491. XML_PARSE_NOENT = 2
  10492. XML_PARSE_DTDLOAD = 4
  10493. XML_PARSE_DTDATTR = 8
  10494. XML_PARSE_DTDVALID = 16
  10495. XML_PARSE_NOERROR = 32
  10496. XML_PARSE_NOWARNING = 64
  10497. XML_PARSE_PEDANTIC = 128
  10498. XML_PARSE_NOBLANKS = 256
  10499. XML_PARSE_SAX1 = 512
  10500. XML_PARSE_XINCLUDE = 1024
  10501. XML_PARSE_NONET = 2048
  10502. XML_PARSE_NODICT = 4096
  10503. XML_PARSE_NSCLEAN = 8192
  10504. XML_PARSE_NOCDATA = 16384
  10505. XML_PARSE_NOXINCNODE = 32768
  10506. XML_PARSE_COMPACT = 65536
  10507. XML_ELEMENT_TYPE_UNDEFINED = 0
  10508. XML_ELEMENT_TYPE_EMPTY = 1
  10509. XML_ELEMENT_TYPE_ANY = 2
  10510. XML_ELEMENT_TYPE_MIXED = 3
  10511. XML_ELEMENT_TYPE_ELEMENT = 4
  10512. XLINK_TYPE_NONE = 0
  10513. XLINK_TYPE_SIMPLE = 1
  10514. XLINK_TYPE_EXTENDED = 2
  10515. XLINK_TYPE_EXTENDED_SET = 3
  10516. XPATH_UNDEFINED = 0
  10517. XPATH_NODESET = 1
  10518. XPATH_BOOLEAN = 2
  10519. XPATH_NUMBER = 3
  10520. XPATH_STRING = 4
  10521. XPATH_POINT = 5
  10522. XPATH_RANGE = 6
  10523. XPATH_LOCATIONSET = 7
  10524. XPATH_USERS = 8
  10525. XPATH_XSLT_TREE = 9
  10526. XML_SCHEMAS_ERR_OK = 0
  10527. XML_SCHEMAS_ERR_NOROOT = 1
  10528. XML_SCHEMAS_ERR_UNDECLAREDELEM = 2
  10529. XML_SCHEMAS_ERR_NOTTOPLEVEL = 3
  10530. XML_SCHEMAS_ERR_MISSING = 4
  10531. XML_SCHEMAS_ERR_WRONGELEM = 5
  10532. XML_SCHEMAS_ERR_NOTYPE = 6
  10533. XML_SCHEMAS_ERR_NOROLLBACK = 7
  10534. XML_SCHEMAS_ERR_ISABSTRACT = 8
  10535. XML_SCHEMAS_ERR_NOTEMPTY = 9
  10536. XML_SCHEMAS_ERR_ELEMCONT = 10
  10537. XML_SCHEMAS_ERR_HAVEDEFAULT = 11
  10538. XML_SCHEMAS_ERR_NOTNILLABLE = 12
  10539. XML_SCHEMAS_ERR_EXTRACONTENT = 13
  10540. XML_SCHEMAS_ERR_INVALIDATTR = 14
  10541. XML_SCHEMAS_ERR_INVALIDELEM = 15
  10542. XML_SCHEMAS_ERR_NOTDETERMINIST = 16
  10543. XML_SCHEMAS_ERR_CONSTRUCT = 17
  10544. XML_SCHEMAS_ERR_INTERNAL = 18
  10545. XML_SCHEMAS_ERR_NOTSIMPLE = 19
  10546. XML_SCHEMAS_ERR_ATTRUNKNOWN = 20
  10547. XML_SCHEMAS_ERR_ATTRINVALID = 21
  10548. XML_SCHEMAS_ERR_VALUE = 22
  10549. XML_SCHEMAS_ERR_FACET = 23
  10550. XML_SCHEMAS_ERR_ = 24
  10551. XML_SCHEMAS_ERR_XXX = 25
  10552.